Why doesn't my custom filter work? |
Please remember that filters are not just plain strings. Your filters need to be written in lower-case, and certain characters and character combinations have special meanings. The most common are listed below:
Common built in special things! %d - Matches any digit (0-9) %D - Matches anything except digits %a - Matches any letter (a-z) %A - Matches anything except letters %w - Matches any digit or letter %W - Matches anything except digits or letters %s - Matches any whitespace (space, tab, newline, etc). %S - Matches anything except whitespace %p - Matches any punctuation %P - Matches anything except punctuation . - Matches any character ^ - Matches the beginning of a line $ - Matches the end of a line [abc] - Matches any of the characters contained between the [] (in this case a, b, or c) [^abc] - Matches any character *except those contained between the [] (in this case, anything *but* a, b, or c). Repetition! - - Matches the previous character 0 or more times until the first occurrance of the next character in the pattern. * - Matches the previous character 0 or more times as many times as possible + - Matches the previous character 1 or more times ? - Matches the previous character 0 or 1 times Escape! Use the '%' symbol before any of the following characters to ignore their special meanings: ( ) . % + - * ? [ ^ $ |