Thread: regex
View Single Post
Old 11-01-2004, 05:10 AM   #3 (permalink)
philthee
Registered User
 
Join Date: Oct 2004
Posts: 15
philthee is on a distinguished road
nice one chief!
\\W removes any non word characters i think.
anyhoos, if i want to put the new string back in to my bandName variable how do i do that?

i now have

Code:
String bandName = toks.nextToken();
String temp = bandName;
Pattern removePeriods = Pattern.compile("[\\.]");
System.out.println(removePeriods.matcher(temp).replaceAll (""));
i tried

String bandName = temp;
but netbeans does not like that statement after the other code because "bandName has already been defined in java Main"
philthee is offline   Reply With Quote