Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^Foo:(?: .*?2,([a-z]))?.*$
/
gm
Input 1
1
New
Foo: 2,b,1,a,3,c " -> match, $1 = "b" Foo: 1,a,2,b,3,c " -> match, $1 = "b" Foo: 1,a,3,c,2,b " -> match, $1 = "b" Foo: 2,b " -> match, $1 = "b" Foo: 1,a,3,c " -> match, $1 = "" Fuu: 1,a,2,b,3,c " -> no match.