DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Roy
Roy

Posted on

Answer: Regex to match string containing two names in any order

You can do checks using positive lookaheads. Here is a summary from the indispensable regular-expressions.info:

Lookahead and lookbehind, collectively called β€œlookaround”, are zero-length assertions...lookaround actually matches characters, but then gives up the match, returning only the result: match or no match That is why they are called β€œassertions”.…

Top comments (0)

Take Your Github Repository To The Next Level

>> Check out this classic DEV post <<