Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
"
(?mixs)1-ASCII:(?#Literales ASCII)\n 1\.1-Los\ 95\ caracteres\ ASCII\ imprimibles:\n \ ! \" \# \$ % & ' \( \) \* \+ , - \. /\n 0123456789 :;<=> \? @\n ABCDEFGHIJKLMNOPQRSTUVWXYZ \[ \\ ] \^ _ `\n abcdefghijklmnopqrstuvwxyz { \| }~ \~ \n 1\.2-Algunos\ ASCII\ extendidos: áÁàÀäÄâÂéíóú\nñÑ\tÿ\ 2-Algunos\ Unicode\ no\ no\ ASCII:∫∬∭∰\u2230
"
gxa
(?mixs)
match the remainder of the pattern with the following effective flags: gxamis
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
x modifier: extended. Spaces and text after a # in the pattern are ignored
s modifier: single line. Dot matches newline characters
1-ASCII:
matches the characters 1-ASCII: literally (case insensitive)
Comment: Literales ASCII
\n matches a line-feed (newline) character (ASCII 10)
1
matches the character 1 with index 1010 (A16 or 128) literally (case insensitive)
\. matches the character . with index 4610 (2E16 or 568) literally (case insensitive)
1-Los
matches the characters 1-Los literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
95
matches the characters 95 literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
caracteres
matches the characters caracteres literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
ASCII
matches the characters ASCII literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
imprimibles:
matches the characters imprimibles: literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
!
matches the character ! with index 3210 (2016 or 408) literally (case insensitive)
\" matches the character " with index 3410 (2216 or 428) literally (case insensitive)
\# matches the character # with index 3510 (2316 or 438) literally (case insensitive)
\$ matches the character $ with index 3610 (2416 or 448) literally (case insensitive)
% & '
matches the characters %&' literally (case insensitive)
\( matches the character ( with index 4010 (2816 or 508) literally (case insensitive)
\) matches the character ) with index 4110 (2916 or 518) literally (case insensitive)
\* matches the character * with index 4210 (2A16 or 528) literally (case insensitive)
\+ matches the character + with index 4310 (2B16 or 538) literally (case insensitive)
, -
matches the characters ,- literally (case insensitive)
\. matches the character . with index 4610 (2E16 or 568) literally (case insensitive)
/
matches the character / with index 3210 (2016 or 408) literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
0123456789 :;<=>
matches the characters 0123456789:;<=> literally (case insensitive)
\? matches the character ? with index 6310 (3F16 or 778) literally (case insensitive)
@
matches the character @ with index 3210 (2016 or 408) literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
ABCDEFGHIJKLMNOPQRSTUVWXYZ
matches the characters ABCDEFGHIJKLMNOPQRSTUVWXYZ literally (case insensitive)
\[ matches the character [ with index 9110 (5B16 or 1338) literally (case insensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case insensitive)
]
matches the character ] with index 3210 (2016 or 408) literally (case insensitive)
\^ matches the character ^ with index 9410 (5E16 or 1368) literally (case insensitive)
_ `
matches the characters _` literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
abcdefghijklmnopqrstuvwxyz {
matches the characters abcdefghijklmnopqrstuvwxyz{ literally (case insensitive)
\| matches the character | with index 12410 (7C16 or 1748) literally (case insensitive)
}~
matches the characters }~ literally (case insensitive)
\~ matches the character ~ with index 12610 (7E16 or 1768) literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
1
matches the character 1 with index 1010 (A16 or 128) literally (case insensitive)
\. matches the character . with index 4610 (2E16 or 568) literally (case insensitive)
2-Algunos
matches the characters 2-Algunos literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
ASCII
matches the characters ASCII literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
extendidos: áÁàÀäÄâÂéíóú
matches the characters extendidos:áÁàÀäÄâÂéíóú literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
ñÑ
matches the characters ñÑ literally (case insensitive)
\t matches a tab character (ASCII 9)
ÿ matches the character ÿ with index 25510 (FF16 or 3778) literally (case insensitive)
\ matches the character with index 1010 (A16 or 128) literally (case insensitive)
2-Algunos
matches the characters 2-Algunos literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
Unicode
matches the characters Unicode literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
no
matches the characters no literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
no
matches the characters no literally (case insensitive)
\ matches the character with index 3210 (2016 or 408) literally (case insensitive)
ASCII:∫∬∭∰
matches the characters ASCII:∫∬∭∰ literally (case insensitive)
\u2230 matches the character with index 223016 (875210 or 210608) literally (case insensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
x modifier: extended. Spaces and text after a # in the pattern are ignored
a modifier: ascii. Force the escape sequences \w, \W, \b, \B, \d, \D, \s and \S to perform ASCII-only matching instead of full Unicode matching
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"
gxa

Test String