aspose file tools
The moose likes Java in General and the fly likes Regular Expression Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Regular Expression" Watch "Regular Expression" New topic
Author

Regular Expression

Alex JabaKumar
Greenhorn

Joined: Apr 12, 2007
Posts: 2
Hi anyone help me out how to write reg.expression for the following...

i need to split the names with the delimiter Mr or MR or mr or mR.

public class RegExp {
public static void main(String[] args) {

String testString = "mrstephMRpaulMRRusswehMrKeerDIMRNDIFDF";
String[] re = testString.split(____);
for(String s : re)
{
System.out.println(s);
}
}
}

Thanks,
alex
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16811
    
  19

What have your tried so far? (hint: regular expression patterns have a case insensitive flag)

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Regular Expression
 
Similar Threads
Method Invocation
A machine-code generator can inline the body of a final method ?
Basic Doubt Regarding JVM
IF strings are immutable why is the variable s appending and changing its obect
new line in jlabel