You need to esacpe twice, once for Java, once for the regex.
Java code is
"\\\\"
makes a regex string of
"\\" - two chars
but the regex needs an escape too so it turns into
\ - one symbol
More Related Contents:
- Remove all occurrences of \ from string
- Regex for converting xml tags key to camel case
- How do i find the first un-escaped quotes in Java?
- How to split a string if any chracter is found in java
- Java: splitting a comma-separated string but ignoring commas in quotes
- Splitting a Java String by the pipe symbol using split(“|”)
- How to escape text for regular expression in Java
- Split string to equal length substrings in Java
- Split string with dot as delimiter
- Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces
- In Java, is there a way to write a string literal without having to escape quotes?
- Using Java to find substring of a bigger string using Regular Expression
- Get the index of a pattern in a string using regex
- How to use regex in String.contains() method in Java
- Compare one String with multiple values in one expression
- Replace the last part of a string
- CharSequence VS String in Java?
- Remove trailing zero in Java
- How do I escape a string in Java?
- Check if string ends with certain pattern
- Java String.replace/replaceAll not working
- Remove all non-“word characters” from a String in Java, leaving accented characters?
- How to implement a SQL like ‘LIKE’ operator in java?
- Raw Strings in Java – for regex in particular. Multiline strings
- How to escape a square bracket for Pattern compilation?
- Regular Expressions on Punctuation
- Illegal Escape Character “\”
- Replacing single ‘\’ with ‘\\’ in Java
- Parse Date from String in this format : dd/MM/yyyy [to dd/MM/yyyy]
- Java replace all square brackets in a string