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 zyx

edit

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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -