Renesas REJ10J1837-0100 Network Card User Manual


 
High-performance Embedded Workshop 4. Regular Expressions
REJ10J1837-0100 Rev.1.00 Nov. 16, 2008
404
4. Regular Expressions
The High-performance Embedded Workshop editor allows you to include special characters in search strings when
performing a find, replace or find in files operation.
These characters are listed in the table below and explained underneath.
Character Function
? This character matches any single character, except the newline character.
For example, t?p matches “top”, “tip” but not “trap”.
* This character matches any number of occurrences (0 or more) of any character except a newline. Thus, this character
will not match across new lines. The * character will match as few occurrences as are necessary to make the rest of the
pattern match.
For example, t*o matches the “to” of “too”, the “tro” of “trowel” and the “ty o” of “sporty orange” but not “smart
orange” because the * character does not match across a new line.
\n This character matches the newline character. \n would be used to search for line endings or in patterns that cross line
boundaries.
Example 1: ;\n
matches every occurrence of a newline following a semicolon
Example 2: ;\nif
searches for a semicolon, a new line and a line beginning with “if”.
\t This character matches the tab character.
Example 1: \t8
Finds every occurrence of a tab character followed by an 8.
Example 2: init\t
Finds every occurrence of a tab character following “init”.
[ ] This matches any one character or a range of single characters listed within the brackets. Brackets cannot be nested.
[-] specifies a range of characters e.g. [a-z] or [0-9]. The beginning character in the range must have a lower ASCII
value than the ending character of the range.
[~] matches a single character if it is not any one of the characters between [~ and ]. This pattern also matches newline
characters, unless the newline character is included within the brackets.
Example 1: [AEIOU]
Finds every uppercase vowel.
Example 2: [<>?]
Finds a literal <, > or ?.
Example 3: [A-Za-z0-9_]
Matches an upper or lowercase letter, a digit or an underscore.
Example 4: [~0-9]
Matches any character except a digit.
Example 5: [ \t\n]
Matches a space, a tab or newline.
Example 6: [\]]
Matches a literal ] if ] is placed after \.
\ This is the regular expression override character. If the character following the backslash is a regular expression
character, it is treated as a normal character. The backslash is ignored if it is followed by a normal (non-regular
expression) character.
Example 1: \*
Searches for every occurrence of an asterisk.
Example 2: \\
Searches for every occurrence of a backslash.