On 10/24/05 4:51 PM, "Marielle Lange" <[EMAIL PROTECTED]> wrote:
> Yuk!!!
>
> If the programmers have to check up regular expressions anyway, can I
> suggest they make the matchtext consider the full text and not just
> match ***within*** a line of text. Okay for "^" and "$" to correspond
> to the start and end of a line of text, this is what happens in all
> programs that allow for regular expression.
>
> But in all programs that implement regular expressions, the following
> happens:
> put replaceText("DA" & cr & "CD","A.?C","") -> DD
> put replaceText("DA" & tab & "CD","A.?C","") -> DD
>
> In revolution, this happens:
> put replaceText("DA" & cr & "CD","A.?C","") -> DA cr CD
> put replaceText("DA" & tab & "CD","A.?C","") -> DD
This is because the PCRE engine needs to be explicitly told that you want to
treat multiple lines as a single "block", otherwise it looks for a match on
each line. To do this, you need to preface the expression with "(?s)", as
in:
put replaceText("DA" & cr & "CD","(?s)A.?C","")
and you get back "DD" as you'd expect. (For more info, see the docs at
http://www.pcre.org/man.txt.)
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution