Re: Help with a regular expression

2022-12-12 Thread Virgil Bierschwale
you can do this to get the positions, and then just get what is between the two positions. store "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid (2.13)" to string store '(' to left_str store ')' to right_str *acid2 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid" clear

RE: Help with a regular expression

2022-12-12 Thread Richard Kaye
Oh, so many ways to do this... You could use Craig Boyd's VFP RegExp.FLL in place of the VBScript RegEx object. -- rk From: ProfoxTech On Behalf Of António Tavares Lopes Sent: Monday, December 12, 2022 8:55 AM To: profoxt...@leafe.com Subject: Re: Help with a regular expression Paul, An

AW: Help with a regular expression

2022-12-12 Thread Jürgen Wondzinski
Hi Paul, you could always just use RegEx in VFP: oRE = CreateObject("VBScript.RegExp") oRE.Pattern = "\\(([0-9.]*)\\)$" ? oRE.Test(acid1) ? oRE.Test(acid2) That said, I haven't played with that pattern, but it doesn't return your desired result. wOOdy -Ursprüngliche Nachricht-

Re: AW: AW: Help with a regular expression

2022-12-12 Thread Paul Newton
Thanks wOOdy! On 12/12/2022 14:00, Jürgen Wondzinski wrote: Argh... Replace cDummy with cResult -Ursprüngliche Nachricht- Von: ProFox Im Auftrag von Paul Newton Gesendet: Montag, 12. Dezember 2022 14:55 An: profox@leafe.com Betreff: Re: AW: Help with a regular expression Hi wOOdy

Re: Help with a regular expression

2022-12-12 Thread Paul Newton
Hi António Subject to testing, that's it!  Many thanks. Paul On 12/12/2022 13:54, António Tavares Lopes wrote: Paul, An implementation of the NumberAtEnd method using Regular Expressions (changed the pattern to give a bit more robustness): m.acid1 = "Methionine =

Help with a regular expression

2022-12-12 Thread Paul Newton
Hi all I've been very quiet for a while so I thought it was about time I chimed in again. I have come across the use of a regex expression in another language which works like this: acid1 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid (2.13)" acid2 = "Methionine =

Re: Help with a regular expression

2022-12-12 Thread Paul Newton
acid1 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid (2.13)" acid2 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid" string = acid1 store '(' to left_str store ')' to right_str pos1 = rat(left_str, string) pos2 = rat(right_str, string) ?

Re: Help with a regular expression

2022-12-12 Thread António Tavares Lopes
Paul, An implementation of the NumberAtEnd method using Regular Expressions (changed the pattern to give a bit more robustness): m.acid1 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid (2.13)" m.acid2 = "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid" ?

Re: AW: Help with a regular expression

2022-12-12 Thread Paul Newton
Hi wOOdy Thanks for both your replies.  I am not sure if it can be done at all using VBScript.RegExp but it would be nice if it could. Your AcidTest function has a problem with cDummy ... Paul On 12/12/2022 13:42, Jürgen Wondzinski wrote: Hi Paul, this would be a pure VFP solution:

AW: Help with a regular expression

2022-12-12 Thread Jürgen Wondzinski
Hi Paul, this would be a pure VFP solution: ** ? AcidTest("Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid (2.13)") ? AcidTest("Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid") FUNCTION AcidTest(cText) LOCAL cResult, nCount nCount

Re: Help with a regular expression

2022-12-12 Thread Paul Newton
Thanks Virgil I am not sure if your suggestion works in the case of "Methionine = (S)-2-amino-4-(methylsulfanyl)-butanoic acid".  I suspect it would end up as "methylsulfanyl" but I haven't tested it yet. Paul On 12/12/2022 13:48, Virgil Bierschwale wrote: you can do this to get the

AW: AW: Help with a regular expression

2022-12-12 Thread Jürgen Wondzinski
Argh... Replace cDummy with cResult -Ursprüngliche Nachricht- Von: ProFox Im Auftrag von Paul Newton Gesendet: Montag, 12. Dezember 2022 14:55 An: profox@leafe.com Betreff: Re: AW: Help with a regular expression Hi wOOdy Thanks for both your replies. I am not sure if it can be done at

Re: Help with a regular expression

2022-12-12 Thread Virgil Bierschwale
it would, because it would return a string instead of a numeric value, but I like the more elaborate ones that I'm seeing. On Mon, Dec 12, 2022 at 8:01 AM Paul Newton wrote: > Thanks Virgil > > I am not sure if your suggestion works in the case of "Methionine = >

Re: Help with a regular expression

2022-12-12 Thread Paul Newton
Oh yes, I had forgotten about that. On 12/12/2022 14:59, Richard Kaye wrote: Oh, so many ways to do this... You could use Craig Boyd's VFP RegExp.FLL in place of the VBScript RegEx object. -- rk From: ProfoxTech On Behalf Of António Tavares Lopes Sent: Monday, December 12, 2022 8:55 AM