Regex Help: How to code so that it searches for a word, but there can't be any other letters after it, only special characters

How can I code regex to find a specific word that doesn’t have any letters in front or behind it? For example, I need it to find the word “Party”, but it gets confused with PartyID. The regex needs to find the word as long as there are no letters at the end of the word. special characters like space _.*{[?! are ok.
I have this so far:

[.\s"]Party

.Party.com = OK
(.PartyID.com = Not OK

Try this one
\bParty(?![a-zA-Z])

It works!! Thank you

1 Like

Hello

Another option if you need it :slight_smile:
\bParty(?=[^A-z]+)

Cheers

Steve

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.