• There seems to be an unnecessary requirement to use ‘/’ as regular expression delimiters. This is quite unfortunate as ‘/’ is likely to occur in the expression and have to be escaped (as illustrated in the examples). This is not a requirement of PHP.

    /\/something\// would be simpler and less error-prone as (for example) %/something/%

    In validate_regex(), replace:

    if ( ! preg_match( '/^\/.*\/$/', $regex ) ) {
         $regex = '/' . $regex . '/';
    }

    with

    if ( substr($regex, 0, 1) !== substr($regex, -1) ) {
         $regex = '@' . $regex . '@';
    }

    (untested example).

Viewing 1 replies (of 1 total)
  • Anonymous User 16850768

    (@anonymized-16850768)

    I agree that it’s an unnecessary requirement. Allowing any regular expression delimiter is on our list of improvements that we’d like to add to Cache Enabler. I don’t have an estimated time on when this change will be introduced.

Viewing 1 replies (of 1 total)

The topic ‘regex delimiters issue’ is closed to new replies.