• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regular expression to select # in words  RSS feed

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to select words that has a # in it. This expression does not seem to work:

� [\\w#+]+ �

It selects all words.
 
author & internet detective
Sheriff
Posts: 38014
603
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bruce,
How about "\\w*#\\w*" - zero or more word characters followed by a # followed by zero or more word characters.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne,

It works!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!