I wrote a regEx program in java. I think that is true but The result is different. please help me to fix that.
my code:
String text ="My wife back me up over my decision to quit my job";
String patternString = "[/w/s]*back(\\s\\w+\\s)*up[/w/s]*.";
Pattern pattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(text);
boolean matches = matcher.matches();
System.out.println("matches = " + matches);
output: matches = false
I'm new in java programming. I want to write a program with regEx to test match of "back up" in the input sentence.
Thanks for your attention.
\\w\\sinstead of/w/s.