0

I want to detect several keywords as whole words within a string, through Regex pattern.

I started with the keyword ERP, by simply using the following pattern: \bERP\b

But this won't work with the keyword C#, meaning that I'm unable to find C# using the pattern \bC#\b In the same way, I'm also unable to find \bC++\b as a whole word.

And \bERP\b doesn't find the following string: ERP6
And I would like for it be detected.

Can someone help me out with a regular expression for detecting only whole words, and entering into account with the above mentioned issues?

Thanks in advance!

Thanks for your reply.

Your pattern unfortunately doesn't recognize whole words. Meaning that if I'm searching for ERP it will find ERP also within the word "PowerPoint". And I want only whole words to be detected. That is, no substrings.

Taking the following test string into account: https://regex101.com/r/pEsc5E/4 , I would like only the following keywords to be detected:

erp ERP c++ C# C++ erp6

blucah
  • 31
  • 2

0 Answers0