A regular expression question# Java - 爪哇娇娃
g*y
1 楼
Given a String, replace | with || if:
(1) | is not within '(single-quote)
(2) | is not followed by | (keep || as is)
I think about the regular expression in Java, seems very difficult to describe
. Finally, I end up with writing a function to do it.
Anyone can solve?
(1) | is not within '(single-quote)
(2) | is not followed by | (keep || as is)
I think about the regular expression in Java, seems very difficult to describe
. Finally, I end up with writing a function to do it.
Anyone can solve?