Advanced Search Expressions
Advanced Search Examples
Be sure to add the preceeding =~(equal tilde) to indicate that the parameter should be interpreted as a regular expression
| To Search for the sequence where preceding character or set of characters occur a certain number of times | {min,max} Specifies Range of occurrences, wheren and m are positive numbers. There are some short cuts: {n} is equivalent to {n, m} where n = m{n, } is equivalent to {n, m} where m = infinity | "a{2, 3}" would require at least two occurrences of the character a and at most 3 occurrences of the character a."[a-z]{3}" would require that a lowercase letter appear 3 consecutive times. "[0-9]{3,}" would require that a digit appear 3 or more consecutive times. "[A-Z]{2,5}" would require that an uppercase letter appear between 2 and 5 consecutive times. |
| To search for the sequence with any character from the specified set | [abc] or [a-c] The square brackets [ ] can be used as a placeholder for a single character which matches any of a set of characters.Use Hyphen "-" for a range, as in [0-9]. | "ta[pb]" would match "tap" and "tab" ("t-a- followed by one character from the set of pb") "r[aeiou]t" would match "rat", "ret", "rot", "rut" ("r- followed by one character from the set of vowels followed by t") "r[aeiou]+t" would match "rat" (plus all of the above), "riot", "root", etc. ("r- followed by one or more vowels followed by t") |
| To search for a sequence with any character Not from the specified set | Placing a carat ^ inside the square brackets [ ] negates the set; meaning the character must match any character not within the set. This is a useful way of specifying a large set of characters, for instance, consonants are "not vowels" | "t[^aeiou]+.*s" matches "thanks", "this", "trappings", etc. ( "t- followed by one or more of any character which is not a vowel followed by zero or more of any character followed by an s") |
| If you want to include special characters like . * ? + { } [ ] ( ) \ in your search | The characters . * ? + { } [ ] ( ) \ are special. If you want to use them as a regular character, you have to escape them by preceding them with a \ | \. matches the dot character and not any character |
| Other examples | '\^s' {starting with '^s', "\" escapes the ^}' B[oO][bB]' {search for BOB, Bob, BOb or BoB } '^$' {search for blank} '[0-9][0-9]' {search for pairs of numeric digits} '[a-zA-Z]' {any with at least one letter} '[^a-zA-Z0-9] {anything not a letter or number} '[0-9]\{3\}-[0-9]\{4\}' {999-9999, like phone numbers} '^.$' {with exactly one character} '"smug"' {'smug', with or without quotes} '"*smug"*' {'smug' within double quotes} '^\.' {any string that starts with a Period "."} '^\.[a-z][a-z]' {start with "." and 2 lower case letters} |