Regex to match words containing X, Y AND Z -
Regex to match words containing X, Y AND Z -
i've been thinking of random things lately, , 1 caught fancy.
how write regexp word contains x, y , z (or matter combination of letters), not in order.
i tried
[^xyz]*x[^xyz]*y[^xyz]*z
but searches in order only
we do
[^xyz ]*[xyz][^xyz ]*[xyz][^xyz ]*[xyz]
but useless because matches xy.
i aiming regexp match words contain x, y , z in of next orders
xyz xzy yzx yxz zxy zyxedit
forgot add together before (sorry bout that)
how making match words like
abxcydz (x, y , z come in order above)
if engine supports lookaheads:
^(?=.*x)(?=.*y)(?=.*z)
or
^(?=[^x]*x)(?=[^y]*y)(?=[^z]*z)
regex
Comments
Post a Comment