MEGASOFT Top > Support > LiquidLogic > Manual > Regular Expression Meta Character List

The following is a list of meta characters that can be used when "regular expressions" is turned on in the find options.
Regular expressions are Perl-compatible types.
Click here for a sample of find and replace using regular expressions.
Regular Expression Samples (our web page)
| Meta Characters | Description | Usage Examples and Results |
|---|---|---|
| (?i) | Identical capitalization of subsequent alphabetic characters. | Example:(?i)abc →Results:Hit on abc, ABC, AbC, etc. |
| (?-i) | Subsequent letters are case-sensitive. | Example:(?-i)abc →Results:Hit on abc only |
| (~) | ・Groups of patterns. Nesting is possible up to 4 layers. ・Specification of the part to be quoted in the new string of substitution (see the part in \1~) |
Example:(AB)+ →Results:AB, ABABAB, etc. |
| (?:~) | Group of patterns ~ can be any pattern, nested up to 4 layers. |
Example:A(?:AB|CD) →Results:Hit AAB, ACD |
| ~|~ | Either of the strings on the left or right side of the |. (~ or ~) | Example:ABC|XYZ →Results:Hits ABC, XYZ |
| [~] | One of the letters ~. | Example 1:[ABC] →Results:Hit A, B, or C. Example 2:[A-G] →Results:Hit A, B, C, D, E, F, or G |
| [^~] | One character not included in ~. |
Example 1:[^ABC] →Results:Hit any other than A, B, or C Example 2:[^A-G] →Results:Hit any of the following except A, B, C, D, E, F, or G |
| . | Any one character. | Example:A.C →Results:ABC, A1C, AxC, etc. |
| * | Zero or more repetitions of the immediately preceding pattern (longest match). | Example:ABC* *Repeat C at least 0 times →Results:AB, ABC, ABCCCCCC, etc. |
| + | One or more repetitions of the immediately preceding pattern (longest match). | Example:ABC+ *Repeat C at least once →Results:ABC, ABCCCCCC, etc. |
| ? | Zero or one repetition of the previous pattern (longest match). | Example:ABC? *Repeat C 0 or 1 time →Results:AB, ABC |
| *? | Zero or more repetitions of the immediately preceding pattern (shortest match). | Example:ABC*? →Results:AB |
| +? | One or more repetitions of the immediately preceding pattern (shortest match). | Example:ABC+? →Results:ABC |
| ?? | Zero or one repetition of the immediately preceding pattern (shortest match). | Example:ABC?? →Results:AB |
| {min,max} | min times to max times repetition of the previous pattern (longest match). *The number of iterations that can be specified is from 0 to 2,000; however, if min=max=0 or min>max, a specified value error occurs. |
Example:ABC{3,5} *Repeat C 3 to 5 times →Results:ABCCC, ABCCCC, ABCCCCC |
| {min,} | min or more repetitions of the immediately preceding pattern (longest match). | Example:ABC{3,} *Repeat C at least 3 times →Results:ABCCC, ABCCCC, ABCCCCC, etc. |
| {num} | num repetitions of the previous pattern The number of repetitions that can be specified is from 1 to 2,000. |
Example:ABC{3} *Repeat C 3 times →Results:ABCCC |
| {min,max}? | min times to max times repetition of the previous pattern (shortest match). *The number of iterations that can be specified is from 0 to 2,000; however, if min=max=0 or min>max, a specified value error occurs. |
Example:ABC{3,5}? →Results:ABCCC |
| {min,}? | min or more repetitions of the immediately preceding pattern (shortest match). | Example:ABC{3,}? →Results:ABCCC |
| {num}? | num repetitions of the previous pattern. The number of repetitions that can be specified is from 1 to 2,000. |
Example:ABC{3}? →Results:ABCCC |
| ^ | Beginning of line | |
| $ | End of line | |
| \n | LF newline (control code 0x0a). *CR+LF newline (control code 0x0d+0x0a) is also hit. However, this excludes cases in which a letter immediately precedes the designation (e.g., ABC\n). To specify only CR+LF newlines, including such cases, use \r\n. |
|
| \t | Tab character (control code 0x09). | |
| \s | All whitespace characters (half-width space, \t, \n, \r, \f). | |
| \S | All characters except for white space (space, \t, \n, \r, \f) | |
| \xnn | Specified in Shift JIS character code (0 to 2 hex digits). | Example:\x41 →Results:A |
| \x{nnnn} | Specified in Unicode (UCS-2) character code (0 to 4 hex digits). | Example:\x{0041} →Results:A |
| \b | Word boundary. | |
| \B | Non-word boundary. | |
| \d | All Numbers. | |
| \D | All except numbers. | |
| \w | All alphanumeric characters and underscores (any character used in a word). | |
| \W | All but alphanumeric characters and underscores. | |
| \l | All lower case letters. | |
| \L | All but lower case letters (all uppercase letters, numbers, Japanese characters, etc.). | |
| \u | All uppercase alphabetic characters. | |
| \U | All but uppercase letters (all lowercase letters, numbers, Japanese characters, etc.). | |
| \ | Escaping meta characters immediately following. (Specifies that the character immediately following is not to be treated as a regular expression symbol (meta-character)). |
Example:\\ →Results:Hit "\" for the letter "\" |
| \a | Alarm (control code 0x07). | |
| \c# | Corresponding control character. *Only one-byte alphabetic characters from A-Z can be specified for #. |
Example:\cV →Results:Hit Ctrl-V |
| \e | Escape (control code 0x1b). | |
| \f | Page break (control code 0x0c). | |
| \r | Return, CR newline (control code 0x0d). *CR+LF newline (control code 0x0d+0x0a) is also hit. However, this excludes cases where a character is specified immediately after (e.g. \rABC). To specify only CR+LF newlines, including such cases, use \r\n. |
|
| \v | Vertical tab (control code 0x0b). | |
| \Q~\E | Meta characters in the ~ portion are not interpreted as meta characters (No need to escape with "\") |
Example:\QC:\Program Files\ABC\E →Results:Hit "C:\Program Files\ABC" |
| (?=~) | Positive lookahead group. Match only if the string behind the matched location is ~. |
Example:ABC(?=1|2) →Results:Hits the ABC portion of ABC1 and ABC2 |
| (?!~) | Negative lookahead group. Matches only if the string behind the matched location is not ~. |
Example:ABC(?!1|2) →Results:Hits ABC portions other than ABC1 and ABC2 |
| (?<=~) | Positive lookbehind group. Match only if the string preceding the match location was ~. |
Example:(?<=1|2)ABC →Results:Hit the ABC part of 1ABC, 2ABC |
| (?<!~) | Negtive lookbehind group. Match only if the string in front of the matched location is not ~. |
Example:(?<!1|2)LIQUID →Results:Hit ABC part except 1ABC and 2ABC |
| Meta Characters | Replace String |
|---|---|
| \n | Newline character. *This will be the line feed character entered with the [Enter] key. |
| \t | Tab character (hard tab). |
| \s | Half-width space. |
| \0 | Whole string found. |
| \N | A string (substring) matching the find pattern enclosed by the Nth "(" and ")", where N is from 1 to 9. |
| \ | Escaping meta characters immediately following. (Specifies that the character immediately following is not to be treated as a regular expression symbol (meta-character)). |