Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Separate the strings
Message
From
26/03/2016 14:12:16
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
26/03/2016 10:52:33
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01633712
Message ID:
01633810
Views:
65
>Try this
>
function Lutz()
>
>	local s
>	text to s noshow flags 1 pretext 7
>		some text
>		>>>You guy
>		line 1
>		line 2
>		...
>		line nnn
>	endtext
>
>	local regexObj, pattern
>	regexObj = createobject('VBScript.RegExp')
>	regexObj.IgnoreCase = .f.
>	regexObj.Multiline = .f.
>	regexObj.Global = .f.
>	
>	pattern = '^(\x0d\x0a|.)*\x0d\x0a>>>You.*\x0d\x0a((\x0d\x0a|.)*)$'
>	regexObj.pattern = m.pattern 
>	
>	
>	local matches
>	matches = m.regexObj.Execute(m.s)
>	
>	do case
>	case !inlist(m.matches.Count, 1)
>		? 'fail'
>	otherwise
>		?matches.item[0].Submatches(1)
>		
>	endcase
>endfunc 
>
Okay. I try to understand this .....

So far I see a submatch containing all, until followed by the line I'm looking for (out of the hip: what happens if this is the first line?) + linebreak, followed by the rest as submatch

Why do I need the first submatch?
What does the | infront of the dot in the enumerations?
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform