Thanks Bob.
I was already replacing \ with \\ in the expected string, but, as you say a
second escape is necessary. The student-generated string comes from JSME,
so Otis's tactic is a good solution in that case.
Mike
Dr Mike Casey
School of Chemistry
UCD
Dublin
01 716 2420
On 6 May 2016 at 1
Thanks for the very fast response Otis. Yes, I had forgotten about the
problem with '\' characters, and your solution works perfectly.
Many thanks,
Mike
Dr Mike Casey
School of Chemistry
UCD
Dublin
01 716 2420
On 6 May 2016 at 16:15, Otis Rothenberger wrote:
> Mike,
>
> I can’t comment on y
Ah, yes. Escaping those back-slashes may be the issue.
$ load $2-butene
C4H8
$ print {*}.find("SMILES","C/C=C/C")
({0:11})
$ print {*}.find("SMILES","C/C=C\C")
({0:11})
$ print {*}.find("SMILES","C/C=C\\C")
({})
So, you see, the real problem is that we are not getting an error message
from that
Mike,
I can’t comment on your SMARTS question, but your first question relates to
escaping JavaScript strings. Hopefully, the first two lines (regular expression
replace) of my compare function are self explanatory:
function compSmiles(key, ans) {
key = key.replace(/\\/g, '');
I have only just returned to active use of Jmol, so I apologise if the
following questions have been dealt with in the two years that I have not
been paying attention.
First a SMILES issue. I use Jmol.evaluateVar (Jmol 14.4.4 2016-04-22) to
check whether a structure drawn by a student in JSME (20
5 matches
Mail list logo