Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

non-word character in Pattern matcher

Status
Not open for further replies.

zhanghong920

Programmer
Nov 15, 2002
27
US
Hello,

I need to use:

Pattern p = Pattern.compile("\\W");
Matcher m = p.matcher(str);

in order to add a space in front of each non-word character (btw, is this a good way to do that?). But "str" includes non English characters and I don't want them to be treated as non-word characters. How could I do that?

Many thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top