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
/
[a-z][primerapellido][a-z](1|\0)(1-9|\0)(0|\0)([0-1]|\0])[@]([alumno]|\0)(.|\0)[ipn][.][mx]$
/
gm
Match a single character present in the list below
[a-z]
a-z matches a single character in the range between a (index 97) and z (index 122) (case sensitive)
Match a single character present in the list below
[primerapellido]
primerapellido
matches a single character in the list primealdo (case sensitive)
Match a single character present in the list below
[a-z]
a-z matches a single character in the range between a (index 97) and z (index 122) (case sensitive)
1st Capturing Group
(1|\0)
1st Alternative
1
1 matches the character 1 with index 4910 (3116 or 618) literally (case sensitive)
2nd Alternative
\0
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
2nd Capturing Group
(1-9|\0)
1st Alternative
1-9
1-9
matches the characters 1-9 literally (case sensitive)
2nd Alternative
\0
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
3rd Capturing Group
(0|\0)
1st Alternative
0
0 matches the character 0 with index 4810 (3016 or 608) literally (case sensitive)
2nd Alternative
\0
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
4th Capturing Group
([0-1]|\0])
1st Alternative
[0-1]
Match a single character present in the list below
[0-1]
0-1 matches a single character in the range between 0 (index 48) and 1 (index 49) (case sensitive)
2nd Alternative
\0]
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
] matches the character ] with index 9310 (5D16 or 1358) literally (case sensitive)
Match a single character present in the list below
[@]
@ matches the character @ with index 6410 (4016 or 1008) literally (case sensitive)
5th Capturing Group
([alumno]|\0)
1st Alternative
[alumno]
Match a single character present in the list below
[alumno]
alumno
matches a single character in the list alumno (case sensitive)
2nd Alternative
\0
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
6th Capturing Group
(.|\0)
1st Alternative
.
. matches any character (except for line terminators)
2nd Alternative
\0
\0 matches the character with index 08 (010 or 016) literally (case sensitive)
Match a single character present in the list below
[ipn]
ipn
matches a single character in the list ipn (case sensitive)
Match a single character present in the list below
[.]
Match a single character present in the list below
[mx]
$ asserts position at the end of a line
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gm

Test String