regex - What's the use of "?!" in this RewriteCond? -
this question has answer here:
- reference - regex mean? 1 answer
i see ?! combination in rewritecond given in .htaccess files, this:
rewritecond %{request_uri} ^(?!/slim_demo/index\.php).*$ to understanding, directive checks if /slim_demo/index.php isn't part of request_uri. odd; use of ? @ front, when has no preceding character match. documentation says ? "makes match optional", thing preceding ? grouping bracket. mean ? making grouping optional? makes sense!
what mystery?
negative lookahead after match: \d+(?!\d| dollars) sample match: 100 in 100 pesos explanation: \d+ matches 100, negative lookahead (?! dollars) asserts @ position in string, follows neither digit nor characters " dollars"
Comments
Post a Comment