I need a regular expression to validate a text for several strings that must be present. Say I have the texts
- Rosy made the boys go wild
- Marys wild boys are very crazy indeed
- Henry is a wild boy
- Sally danced with 3 boys last night
And I want to Match the sentences that has both ‘boys’ AND ‘wild’ (in any order). The correct matches are 1 and 2, but not 3 and 4.
Anybody?
1 Answer