I have the following regular expression to match all words of a text starting with "+".
Pattern.compile("\\+[\\w-]+");
This works well and matches "+Foo or +Bar" - "+Foo" and "+Bar" .
How to extend a regular expression to ignore words starting with an escaped "+" - char?
"+Foo or +Bar but no \\+Hello" should match "+Foo" and "+Bar" , but not "+Hello" .
(It should work for JDK1.7.)
Thanks in advance for your help!
java regex
t777
source share