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
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
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-
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
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 =
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 =
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)
?
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"
?
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:
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
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
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
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 =
>
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
14 matches
Mail list logo