Qfree Regex Replacement for QF_REMatchText QF_REExtractText QF_RESplitText?


is there a dropin replacement for old Qfree Regex commands ?

Thanks Armin

You can try this: http://forums.4d.fr/Post/EN/7161740/1/7161741#7161741

Not one but 2:
all you wanted to know about regex in 4d, by Maurice Inzirillo
more “nude”, designed to easily replace qfree, by Vincent de Lachaux

Cool, thank you

Vincent when I use your code for qfree replacement, I get no result. Is the Regex formatting for qfree different to 4d Regex formatting ?

If have this code to parse an email header:

RegEx: ([^\x00-\x1f\x7f-\xff :]+):[\t ]+(.+\n(?:[\t ]+.+\n)*)

<code 4D>
$pattern_t:="([^\x00-\x1f\x7f-\xff :]+)" //matches keyword field (group 1)
$pattern_t:=$pattern_t+":[\t ]+" // : space/tab
$pattern_t:=$pattern_t+"(" //value block (group 2)
$pattern_t:=$pattern_t+".+\n" //everything up to the new line (’.’ doesn’t match newline)
$pattern_t:=$pattern_t+"(?:[\t ]+.+\n)*" //then zero or more lines which start with whitespace (multiline headers)
$pattern_t:=$pattern_t+")" //end block (group 2)

$groups_t:=“1 2”
ARRAY TEXT($matches_at;0;0)

$error_i:=Rgx_ExtractText ($pattern_t;$headers_t;$groups_t;->$matches_at)//;$flags_i)
//$error_i:=QF_REExtractText ($pattern_t;$headers_t;$groups_t;$matches_at;$flags_i)

</code 4D>

But the $matches_at array is empty.

When I test this with Regex Lab I get an error:

[]19265008;“Your comment here…”[/]

Test Mail Header: http://forums.4d.fr/4DBB_Main/x_User/835739/files/19265051.zip

There is no need to double escape your pattern with regexLab