regex - How do I match several strings in a text using Regular Expression? -
I need a regular expression to validate a text for many strings that should be present in the present. Say that I have texts
- Roses made the boys wild
- The wild boys of Mary are really very crazy
- Henry
and I both have 'boys' and 'wild' (any order I want to match both sentences). The correct matches are 1 and 2 but not 3 and 4.
Anyone?
<(? = \ Bboys \ b) * (? = \ Bwild \ b) | * (? = \ Bwild \ b) * (? = \ Bboys \ b)
Comments
Post a Comment