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
/
(\w+):"?\K((?(?<=")[^"]*|\w*))
/
g
Input 1
tag:videos will extract videos tag:"my videos" will extract my videos riding ponies tag:ponies will extract ponies riding ponies tag:"pony rider" will extract pony rider riding ponies tag: will extract nothing travelling the world tag:"aussie guy" country:Australia
Substitution
tag:videos will extract videos tag:"my videos" will extract my videos riding ponies tag:ponies will extract ponies riding ponies tag:"pony rider" will extract pony rider riding ponies tag: will extract nothing travelling the world tag:"aussie guy" country:Australia