Regular Expressions Reminder: Commonly used special symbols in - - PowerPoint PPT Presentation

regular expressions reminder commonly used special
SMART_READER_LITE
LIVE PREVIEW

Regular Expressions Reminder: Commonly used special symbols in - - PowerPoint PPT Presentation

Regular Expressions Reminder: Commonly used special symbols in Python regular expressions Symbol Meaning . matches any character + 1 or more * 0 or more () capture group \d digit \D non-digit \s whitespace \S non-whitespace \w


slide-1
SLIDE 1

Regular Expressions

slide-2
SLIDE 2

Reminder: Commonly used special symbols in Python regular expressions

Symbol Meaning . matches any character + 1 or more * 0 or more () capture group \d digit \D non-digit \s whitespace \S non-whitespace \w alphanumeric \W non-alphanumeric

slide-3
SLIDE 3

Character sets: [abcd] matches the letters a, b, c, d

slide-4
SLIDE 4

Character sets: [abcd] matches the letters a, b, c, d

String: gray Regex: gr[abcd]y

slide-5
SLIDE 5

Character sets: [abcd] matches the letters a, b, c, d

String: gray Regex: gr[abcd]y Match: gray

slide-6
SLIDE 6

Character sets: [abcd] matches the letters a, b, c, d

String: grey Regex: gr[abcd]y

slide-7
SLIDE 7

Character sets: [abcd] matches the letters a, b, c, d

String: grey Regex: gr[abcd]y Match: Does not match!

slide-8
SLIDE 8

A character set matches exactly one letter

String: -ATGGTCTA- Regex: -[ATGC]-

slide-9
SLIDE 9

A character set matches exactly one letter

String: -ATGGTCTA- Regex: -[ATGC]- Match: Does not match!

slide-10
SLIDE 10

A character set matches exactly one letter

String: -ATGGTCTA- Regex: -[ATGC]+-

slide-11
SLIDE 11

A character set matches exactly one letter

String: -ATGGTCTA- Regex: -[ATGC]+- Match: -ATGGTCTA-

slide-12
SLIDE 12

Negative character sets: [^abcd] matches anything but a, b, c, d

String: gray Regex: gr[^abcd]y

slide-13
SLIDE 13

Negative character sets: [^abcd] matches anything but a, b, c, d

String: gray Regex: gr[^abcd]y Match: Does not match!

slide-14
SLIDE 14

Negative character sets: [^abcd] matches anything but a, b, c, d

String: grey Regex: gr[^abcd]y

slide-15
SLIDE 15

Negative character sets: [^abcd] matches anything but a, b, c, d

String: grey Regex: gr[^abcd]y Match: grey