when i use pattern = new Pattern("C++"),it report wrong ,it regard ++ as specical char ,in fact ,it not a specical char,just a common char,If I want to match all string such as "C++",what should i do??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when i use pattern = new Pattern("C++"),it report wrong ,it regard ++ as specical char ,in fact ,it not a specical char,just a common char,If I want to match all string such as "C++",what should i do??
Use backslash to escape special chars
new Pattern("C\\+\\+")
see more on escaping here:
http://jregex.sourceforge.net/gstarted.html#appendix-d