R
regexer
Gast
Java:
String s = "ab\\+";
System.out.println( s.matches( "ab\\\\+" ) ); //false
Wie muss ich den RegEx anpassen, um "true" zu erhalten?
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
String s = "ab\\+";
System.out.println( s.matches( "ab\\\\+" ) ); //false
neinZum Escapen des "\" benötige ich "\\" oder
String s = "\\";
System.out.println( s.matches( "\\\\" ) );
und warum 4 "\" zum Escapen des "+" Zeichens?
String s = "+";
System.out.println( s.matches( "\\+" ) );
s.matches(Pattern.quote("ab\\+"))
"ab\\+".matches(Pattern.quote(s))