• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular Expression

 
Alex JabaKumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21021
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have your tried so far? (hint: regular expression patterns have a case insensitive flag)

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic