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:

  1. (?i) - turn on ignore case option
  2. \b - first or last character in word
  3. b
  4. \w* - alphanumeric, number of repetitions
  5. \b - first or last character in word

so find bword , bword.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -