Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy PCRE Error Message 'Compilation failed:' ???

    Hi Guys, I have a script that ran fine forever, now, with PHP 4.3.1 (maybe) or other reasons that I don't know.

    This is the error

    Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1
    this is the PHP

    PHP Code:
    preg_match("/\\$key/i"$line 
    I am doing a chop() to the string before.

    I am stuck, any ideas?

    Steve

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check out

    http://www.google.ca/search?q=Compil...e+Search&meta=

    Google Link.

    Lots of people have this error!!!

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dunno, bro. Sorry

    However, many of the Google results seem to be PostNuke sites....
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the feedback!

    Whew, this is killing me. And ya, I have a demo tommorow morning. What do tey call that? Murphys law.

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmmm, according to some text-file at pcre.org
    4. The following Perl escape sequences are not supported:
    \l, \u, \L, \U, \P, \p, and \X. In fact these are imple-
    mented by Perl's general string-handling and are not part of
    its pattern matching engine. If any of these are encountered
    by PCRE, an error is generated.
    So, are you force-escaping any character that comes through? You should only escape what's necessary
    Last edited by beetle; 04-02-2003 at 04:46 AM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    AHHHH, yes, I think I need to clean up the string '$line' abit more...





    It worked untill I went to 4.3.1

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    4.3.1 must be more strict in implementing PCRE then, or your error-reporting has changed.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The error reporting give me a warning, but it doesn't work at all.

    I wonder what '\L, \l, \N, \P, \p, \U, \u, or \X' are? Returns? Tab?

    I am trying to str_replace them, but I am having no luck

    $line = str_replace("/\L", "", $line);
    $line = str_replace("\\L", "", $line);
    $line = str_replace("\L", "", $line);



  • #9
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the line you gave before, what is $key ?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    Oakville
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What I am doing is datastriping a website. $key is an array with a bunch of thing that I am trying to match, if it matches I record that in the database. If I '@' the preg at least the script won't crash my server. But the script no longer works right.

    Beets, thanks for the support, I am heading home. I might try this later on tonight.



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •