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
/
^( ( # a dummy option, defines some frequently used capture groups (?!x)x # always false, so nothing matches this and the following groups ever (?'name'[^_]+) # group "name" (?'os'windows|linux|osx) # group "os" ) | ( # pattern foo foo_\g'name'_\g'os' ) | ( # pattern bar \g'name'_bar_\g'os'_foo_\g'os' ) )$
/
x
Unit Tests
There are no unit tests, click
here
to add some.