I have a regular expression, read from an XML, that is being used from two different tools. A Java one and a C++ one.
[…!\?\.](\)|\]|“|'|"|’|”|‘|´|''|»)*
Trying to match the following string:
!!!!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''??
The input data comes from some "big data" stored on HDFS.
In Java, it goes on backtracking forever, while in the C++ version it goes fine. The problem is that I cannot change the regular expression, since it is used by other external modules too, and it's hard to motivate a change since it works fine from C++.
Is there a way I could avoid this issue by not changing the regex? I tried appending a "$" after it with no luck.