How can I express "not preceded by" in a Java regular expression? For example I would like to search for ":" but only when it is not directly preceded by "\". How can I do this?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Did you try using a character class with the complement operator?
Use a negative lookbehind:
The reason for the four backslashes is:
\\
to match a single backslash.\\
, giving a total of four.Example code:
Output: