Re: [Jmol-users] SMILES and SMARTS problems

2016-05-06 Thread Mike Casey
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

Re: [Jmol-users] SMILES and SMARTS problems

2016-05-06 Thread Mike Casey
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

Re: [Jmol-users] SMILES and SMARTS problems

2016-05-06 Thread Robert Hanson
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

Re: [Jmol-users] SMILES and SMARTS problems

2016-05-06 Thread Otis Rothenberger
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, '');

[Jmol-users] SMILES and SMARTS problems

2016-05-06 Thread Mike Casey
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