The search and Replace window provides controls to quickly find specific or partial text in accordance with defined search options, then replace that text with specified new text.
The search and replace window can be opened by selecting the Search and Replace option from the segment grid column header menu, or via translate5 shortcuts:
The following list contains the regular expressions which are not supported by translate5, because they are black-listed:
\x[a-fA-F0-9]{2} //Hexadecimal escape | \xFF where FF are 2 hexadecimal digits | Matches the character at the specified position in the code page | \xA9 matches © when using the Latin-1 code page \n //Character escape \r //Character escape \t //Character escape \f //Character escape \v //Character escape c[a-zA-Z] //Control character escape \cA through \cZ Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cM\cJ matches a Windows CRLF line break //Control character escape \ca through \cz Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cm\cj matches a Windows CRLF line break \0 //NULL escape \(?:[1-7][0-7]{0,2}|[0-7]{2,3}) //Octal escape (.*)\|(.*) //javascript: a|ab matches a in ab | In POSIX ERE: a|ab matches ab in ab \\[\^\]\-] //\ (backslash) followed by any of ^-]\ \b //javascript: [\b\t] matches a backspace or a tab character. \B //javascript: \B. matches b, c, e, and f in abc def \d //Shorthand Character Classes \D //Shorthand Character Classes \s //Shorthand Character Classes \S //Shorthand Character Classes \w //Shorthand Character Classes \W //Shorthand Character Classes \h //Shorthand Character Classes \?\? //abc?? matches ab or abc \*\? //".*?" matches "def" and "ghi" in abc "def" "ghi" jkl \+\? //".+?" matches "def" and "ghi" in abc "def" "ghi" jkl {[0-9],[0-9]}\? // {[0-9],}\? // e. g. \u78af //Specific Unicode code points can not be searched with regular expressions. The code point shown here is an example. \(\?\:.*?\) //Non-capturing parentheses group the regex so you can apply regex operators, but do not capture anything. \(.*?\)=\\[0-9] //(abc|def)=\1 matches abc=abc or def=def, but not abc=def or def=abc. \(\?\=.*?\) //Matches at a position where the pattern inside the lookahead can be matched. Matches only the position. It does not consume any characters or expand the match. In a pattern like one(?=two)three, both two and three have to match at the position where the match of one ends. \(\?\!.*?\) //Similar to positive lookahead, except that negative lookahead only succeeds if the regex inside the lookahead fails to match. \[\:(.*)\:\] |
Refex | Description |
---|---|
\x[a-fA-F0-9]{2} | Hexadecimal escape | \xFF where FF are 2 hexadecimal digits | Matches the character at the specified position in the code page | \xA9 matches © when using the Latin-1 code page |
\n | Character escape |
\r | Character escape |
\t | Character escape |
\f | Character escape |
\v | Character escape |
c[a-zA-Z] | Control character escape \cA through \cZ Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cM\cJ matches a Windows CRLF line break. Control character escape \ca through \cz Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cm\cj matches a Windows CRLF line break |
\0 | NULL escape |
\(?:[1-7][0-7]{0,2}|[0-7]{2,3}) | Octal escape (Any character with a character code lower than 256 ex: \251 ) |
(.*)\|(.*) | javascript: a|ab matches a in ab | In POSIX ERE: a|ab matches ab in ab |
\\[\^\]\-] | \ (backslash) followed by any of ^-]\ |
\b | javascript: [\b\t] matches a backspace or a tab character. |
\B | javascript: \B. matches b, c, e, and f in abc def |
\d | Shorthand Character Classes |
\D | Shorthand Character Classes |
\s | Shorthand Character Classes |
\S | Shorthand Character Classes |
\w | Shorthand Character Classes |
\W | Shorthand Character Classes |
\h | Shorthand Character Classes |
\?\? | abc?? matches ab or abc |
\*\? | ".*?" matches "def" and "ghi" in abc "def" "ghi" jkl |
\+\? | ".+?" matches "def" and "ghi" in abc "def" "ghi" jkl |
{[0-9],[0-9]}\? | |
{[0-9],}\? | |
\u[a-fA-F0-9]{4} | Specific Unicode code points can not be searched with regular expressions. The code point shown here is an example. ex: \u78af |
\(\?\:.*?\) | Non-capturing parentheses group the regex so you can apply regex operators, but do not capture anything. |
\(.*?\)=\\[0-9] | (abc|def)=\1 matches abc=abc or def=def, but not abc=def or def=abc. |
\(\?\=.*?\) | Matches at a position where the pattern inside the lookahead can be matched. Matches only the position. It does not consume any characters or expand the match. In a pattern like one(?=two)three, both two and three have to match at the position where the match of one ends. |
\(\?\!.*?\) | Similar to positive lookahead, except that negative lookahead only succeeds if the regex inside the lookahead fails to match. |
\[\:(.*)\:\] |
The following table illustrates some commonly used metacharacters and constructs in a regular expression.
Metacharacter | Behavior |
---|---|
^ | matches the position at the beginning of the searched string |
$ | matches the position at the end of the searched string |
[…] | matches any character specified inside the square brackets |
[^…] | matches any character not specified inside the square brackets |
* | matches the preceding character zero or more times |
+ | matches preceding character one or more times |
{n} | matches n number of instances of the preceding character |
{m,n} | matches from m to n number of instances of the preceding character |