Move the InChI Readers to cdk-inchi module.#1235
Conversation
|
| logger.debug("Parsing atom data: ", atomsEncoding); | ||
|
|
||
| Pattern pattern = Pattern.compile("([A-Z][a-z]?)(\\d+)?(.*)"); | ||
| Pattern pattern = Pattern.compile("([A-Z][a-z]?)(\\d++)?(.*+)"); |
There was a problem hiding this comment.
Never seen this extra + syntax before. Got some info for me? Love to read up on this.
|
See "Possessive quantifiers" https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
Not always what you want but it is in this case and avoids the SonarCloud warning of denial of service. You need to be careful though as
The a's get all consumed and doesn't backtrack. The other option is using a different regex library (e.g. dk.brics.Automata) which use a state machine to matche in linear time. |



No description provided.