Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
system:regex:regex_notation [2018/04/13 11:40]
smayr [Regex Quick Reference]
system:regex:regex_notation [2018/04/13 11:52] (current)
smayr [Regex Quick Reference]
Line 25: Line 25:
  
 General Tokens: General Tokens:
 +^ Symbol       ^ Description ^
 | \n           | Newline | | \n           | Newline |
 | \r           | Carriage return | | \r           | Carriage return |
 | \t           | Tab | | \t           | Tab |
 +| \f           | Form-feed |
 | \0           | Null character | | \0           | Null character |
  
 Anchors: Anchors:
 +^ Symbol       ^ Description ^
 | \G           | Start of match | | \G           | Start of match |
 | <nowiki>^</nowiki>            | Start of string | | <nowiki>^</nowiki>            | Start of string |
Line 42: Line 45:
 | \W           | Any non-word character | | \W           | Any non-word character |
  
- +Flags/Modifiers (eg: "/regex here.../g"): 
-Flags/Modifiers (eg: "/.../i"):  +^ Symbol       ^ Description  
-| g  | Blobal |+| g  | Global (do not return after first match) |
 | i  | Case insensitive | | i  | Case insensitive |
-| m  | Multiline (make dot match newlines) +| m  | Multiline (dot matches newlines, <nowiki>^</nowiki> and $ match start/end of line)  | 
-| s  | Single line  +| s  | Single line (dot matches newline) 
-| u  | Unicode |  +| u  | Unicode (match with full unicode) |  
-| x  | Ignore whitespace | +| x  | eXtended (ignore whitespace) |  
 +| X  | eXtra (disallow meaningless excapes
 | o  | Perform #{...} substitutions only once | | o  | Perform #{...} substitutions only once |
 +| A  | Anchored (anchor to start of pattern) | 
 +| J  | Duplicate group names (allow duplicate subpattern names) | 
 +| D  | Dollar end only ($ matches only end of pattern) | 
  
 == Using Regex in PHP == == Using Regex in PHP ==
Line 86: Line 93:
 == References == == References ==
   * [[http://www.rexegg.com/regex-quickstart.html|Regex Cheat Sheet]]   * [[http://www.rexegg.com/regex-quickstart.html|Regex Cheat Sheet]]
 +  * [[https://regex101.com|Regex 101]]