Regex to match group of jumbled words by preserving word set order

I want to match a set of words by preserving order, for e.g.)

I want to accept only [ jack james ] [jason jules]

i.e)
words within [] can interchange but the word block [] should preserve order.

Valid sentences:
jack james jules jason
james jack jason jules

Invalid sentences:
jules jason jack james
jack jules jason james

sample regex I have come up so far to solve the above problem
^((?=.\bjack\b)(?=.\bjames\b))((?=.\bjason\b)(?=.\bjules\b)).*$

Which is not working as expected.

Can this problem be solved by regex? What would be the recommended approach to solve this?


Download regex.to.match.group.of.jumbled.words.by.preserving.word.set.order.zip
Direct Link


Download


Download regex.to.match.group.of.jumbled.words.by.preserving.word.set.order.zip
Mediafire


Download


Download regex.to.match.group.of.jumbled.words.by.preserving.word.set.order.zip
Uploading


Download


Download regex.to.match.group.of.jumbled.words.by.preserving.word.set.order.zip
Uploadable


Download


Download regex.to.match.group.of.jumbled.words.by.preserving.word.set.order.zip
Speedyshare


Download

Both comments and pings are currently closed.

Comments are closed.