Compilation failed: POSIX collating elements are not supported

前端 未结 2 1522
情话喂你
情话喂你 2021-01-01 05:00

I\'ve just installed a website & legacy CMS onto our server and I\'m getting a POSIX compilation error. Luckily it\'s only appearing in the backend however the client\'s

2条回答
  •  耶瑟儿~
    2021-01-01 05:42

    [...] are character classes, they match any character between the brackets, you don't have to add | between them. See character classes.

    So [abcd] will match a or b or c or d.

    If you want to match alternations of more than one character, for example red or blue or yellow, use a sub pattern:

    "(red|blue|yellow)"
    

    And you guessed, [abcd] is equivalent to (a|b|c|d).


    So here is what you could do for your regex:

    For

    $trenner = "[\040|\n|\t|\r]*";
    

    Write this instead:

    $trenner = "[\040\n\t\r]*";
    

    And for

    "[=\"|=\'|=\\\\|=]"
    

    You could do

    "(=\"|=\'|=\\\\|=)"
    

    Or

    "=[\"'\\\\]?"
    

    BTW you could use \s instead of $trenner (see http://www.php.net/manual/en/regexp.reference.escape.php)

提交回复
热议问题