Programming

Regex Syntax

steloflute 2015. 6. 17. 23:09

Regex Syntax:

 

a|b Matches a or b
gr(a|e)y Matches gray or grey
. Matches any single character
[abc] Matches a single character a, b or c
[^abc] Matches any single character except a, b or c
[a-z] Matches a single charactor in the range a to z
[a-zA-Z] Matches a single charactor in the range a to z or A to Z
^ Matches the start of the filename
$ Matches the end of the filename
* Matches the preceding element zero or more times
? Matches the preceding element zero or one times
+ Matches the preceding element one or more times
{x} Matches the preceding element x times
{x,} Matches the preceding element x or more times
{x,y} Matches the preceding element between x and y times

 

From: Everything's help