Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Rewriting a regexp to avoid segmentation fault in php

  •  04-21-2007, 2:19 AM

    Rewriting a regexp to avoid segmentation fault in php

    Hello,
    I have written a regular expression that I think is syntactically correct but it when used with some versions of php it will cause a segmentation fault. While PCRE Version 7 is being accused for this bug it's not of much help to me. I am wondering if perhaps there is a way to rewrite the expression. Maybe someone has ideas on an equivalent regexp that hopefully won't cause the segmentation fault. It might be worth mentioning that the regexp starts to cause the segmentation faults when the subject is rather large (~150kB and up).
    Here is the regular expression in question (when used with preg_match):
    preg_match('/^(?:\((?:\x27[^\x27]*\x27,){5}\x27[^\x27]{32}\x27,\x27666\x27\),)+$/u', $sqldata);
    I would be very glad if someone has any ideas on this.
    /Robert
View Complete Thread