Regex To Match The First Word After A Specific Word

Category: Strings

A regular expression that matches the first word after a specific word in a sentence.

/(?<=\bWORD\s)(\w+)/g

Matches:

  • A regular expression that matches the first word after a specific word
  • A regular expression that matches the first word after a specific word in a sentence.

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.