This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Regular Expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regular Expression" Watch "Regular Expression" New topic

Regular Expression

Alex JabaKumar

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)

Henry Wong

Joined: Sep 28, 2004
Posts: 18541

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: Regular Expression
Similar Threads
new line in jlabel
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