c# - Find words with specified first letter (Regex) -
i need regex find words starting, example, whith letters "b" or "b". in sentence bword abword bword
need find bword
, bword
. curresnt regex is: [bb]\w+
(first character space), doesn't find bword
.
thanks in advance.
try using following regex: (?i)\bb\w*\b
it means:
(?i)
- turn on ignore case option\b
- first or last character in wordb
\w*
- alphanumeric, number of repetitions\b
- first or last character in word
so find bword
, bword
.
Comments
Post a Comment