I have cool regex from here Regex to match string containing two names in any order
^(?=.*\bjack\b)(?=.*\bjames\b).*$
But I need substring as result.
For example:
hi jack here is james whats up
- I need as result
jack here is james
hi james here is jack whats up
- I need as result
james here is jack
I cannot use jack or james in regex more than 1 time.
How can I get it?