Timeline for What is the correct regular expression for InChI?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 6, 2017 at 15:35 | comment | added | Cleb | @Martin-マーチン: And of course, if there is a better way of doing it, I would be more than happy to know about it. I just took the one provided, noticed that it failed and modified it that it works. If there is a better way that also checks each layer it would be great to know about it! | |
Sep 6, 2017 at 15:33 | history | edited | Cleb | CC BY-SA 3.0 |
deleted 12 characters in body
|
Sep 6, 2017 at 15:33 | comment | added | Cleb | @Martin-マーチン: All I need is a regex that tells me whether a given string has the correct form of an InChI, so it should identify all InChIs as correct. Clearly, one will then also match a lot of things that are not chemically relevant as your example but it should at least work for each valid InChI which the former regex apparently did not do. | |
Sep 6, 2017 at 14:59 | comment | added | Martin - マーチン♦ | As for your answer (I am not a down-voter), this is not a programming subsite, so you need to explain (either in the question or in the answer) what the parts of the regex actually do, and why they do it, right now this is all rather confusing. (Also please do not use any edit statements, revise the complete answer as necessary and make it read consistently. If anyone needs to know what changed, there is an extensive edit history available.) | |
Sep 6, 2017 at 14:55 | comment | added | Martin - マーチン♦ |
Why all the fuzz? If you are not performing a complete sanity check of every layer, then why match it at all? For example complete garbage like InChI=1/A100/cAfoobar would be matched. therefore InChI\=1S?\/[A-Za-z0-9\.\+]+(\/.+) already matches all correct InChI (and extracts the relevant layers, but it also matches all incorrect garbage. Somehow I fail to see how this string could be helpful anywhere...
|
|
Sep 6, 2017 at 13:24 | history | edited | Cleb | CC BY-SA 3.0 |
added 472 characters in body
|
Sep 4, 2017 at 12:09 | comment | added | Cleb | @downvoter: Could you please explain why you downvoted? It clearly addresses the question and provides explanation + sources. If there is something wrong, it would be nice to know what so that it can be fixed. | |
Sep 4, 2017 at 9:50 | history | answered | Cleb | CC BY-SA 3.0 |