I am writing a parser in which I want to parse arithmetic expressions like: /hdfs://xxx.xx.xx.x:xxxx/path1/file1.jpg+1 I want to parse it change the infix to postfix and do the
In a double quoted string backslash is an escape character. If you mean to use the literal backslash in a double quotes string you must escape it, thus "\d"
should be "\\d"
.
Furthermore you do not need to escape the regex dot within a character class, since dot has no special meaning with a character class. So "[\d.]"
should just be "[\d.]".
You can also forgo all this escaping business by using the raw interpolator or multi-line string literals using triple quotes.