-1

So im looking to get a regex to find exactly some words and not all word that contain that word My regex looks like this

"^.*?(java.*|test.*|dev.*).*$"

At this moment:

  • javascript : matches - should NOT match
  • tester : matches - should NOT match
  • Im a dev : should match

I want to make it so that only exactly these words"java,test,dev" are matched and not every word that contains these words.

Roxx
  • 1
  • 1

1 Answers1

0

For PCRE you can use word boundaries

\b(java|test|dev)\b

https://regex101.com/r/URxffV/1

on8tom
  • 1,766
  • 11
  • 24