1

I'm looking to match the following strings:

Complete this list for Dave by five
Complete this list for Paul by five
Complete this list for Adam by five

Here is the regex I've tried:

*Complete\sthis\slist\sfor\sDave|Paul|Adam\sby\sfive*

But in my regex checker, Paul is matched even if the rest of the string is excluded (not present).

I've also tried:

*Complete\sthis\slist\sfor\s\bDave|Paul|Adam\b\sby\sfive*

But I still get a match with a single word 'Paul'.

Working in Perl regex, what would be the best way to capture all variations of the string in regex?

Thanks,

Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47
greenage
  • 399
  • 3
  • 13

0 Answers0