|
|
Regular Expressions used in htaccess - Apache
|
Views : 433
|
|
Tagged in : Apache
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Regular Expressions used in htaccess
1. Patterns ("wildcards") are matched against a string
2. Normal alphanumeric characters are treated as normal
3. Special characters:
* . (full stop) - match any character
* * (asterix) - match zero or more of the previous symbol
* + (plus) - match one or more of the previous symbol
* ? (question) - match zero or one of the previous symbol
* \? (backslash-something) - match special characters
* ^ (caret) - match the start of a string
* $ (dollar) - match the end of a string
* [set] - match any one of the symbols inside the square braces.
* (pattern) - grouping, remember what the pattern matched as a special variable
Examples:
* a+ matches "a", "aaaa", "aaaaaaaaaaaa", but not "bbb"
* [ab]+ matches, "a", "b", or any length combination of the two
* \.s?html? matches ".htm", ".shtm", ".html" or ".shtml"
* (.+)/1999/(.+) matches "subject/1999/psy1011/", and also stores "subject" in $1 and "psy1011/" in $2.
|
|
By Rekha, On - 2010-02-17 |
|
|
|