Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^=\?(?<ifNull>(?:\\(\\\\)*:|[^:])*)(?<!\\):(?<ifNotNull>(?:\\(\\\\)*:|[^:])*)$
/
gm
Input 1
1
New
=?This value would be returned if null or empty.:This would be returned if not. =?This\:is\:a\:demo of what \:happens\:with:an escaped \: separator. =?This is what happens with an invalid value. and don't forget the =? on the front of the string:or you won't get any results.
Extraction