Regular Expressions

 

 

Metacharacter

Definition

.

Matches any character except newline

w

Word character [a-zA-Z_0-9] & chars 170 181 186 192-255

W

Nonword character [^a-zA-Z_0-9] & chars 170 181 186 192-255

d

Digit [0-9]

D

Nondigit [^0-9]

n

Newline

r

Carriage return

t

Tab

f

Form feed

s

Whitespace [ fnrtvx85p{Z}]

S

Nonwhitespace [^ fnrtvx85p{Z}]

^

Beginning of a string

$

End of a string

A

Beginning of the string (multi-line mode)

Z

End of the string (multi-line mode)

b

Word Boundary, boundary between w and W

B

Not a word boundary

p{prop}

Character contained by Unicode property

Leave a Reply

Your email address will not be published. Required fields are marked *