regex - What's the use of "?!" in this RewriteCond? -


this question has answer here:

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -