REFERENCE:

Find and Replace dialogs

The Find dialog has two variants.

Search on Diagrams

Text to find

Options

Global Text Search

Find page

This page enables you to search for a string in the file currently open and focused in the Editor.

Search

Enter the string you want to locate in the current file or select from the drop-down history of recently searched strings.

Scope

Choose an option to control the scope of the search.

Common Options

These options are applicable to all pages of the dialog tabset. Changes do not apply to individual pages. For example, if you change Case Sensitive while the Find page is displayed, and uncheck it after switching to the Replace page, it remains checked if you return to Find.

Regular Expressions

These options apply to all pages in the same way as described in the previous section. Searches in files support regular expressions. It is beyond the scope of this document to teach this concept found in many programming languages. A brief summary of the expressions supported by this dialog is included... see Supported Regular Expressions.

Replace page

This page enables you to locate and replace a string in the file currently open and focused in the Editor. The controls on this page are identical to those on the Find page with one addition:

Find in Files page

This page enables an extended find across multiple files.

Replace in Files page

This page enables an extended find and replace operation across multiple files. The controls are the same as for Find File with one addition:

Supported Regular Expressions

Together supports the following summarized Perl5 regular expressions through use of the OROMatcher TM Perl5 classes. For a definitive reference, you should consult http://www.perl.org/CPAN/doc/manual/html/pod/perlre.html and also the book Programming Perl, 2nd Edition from O'Reilly & Associates.

For efficiency reasons the character set operator [...] is limited to work only on ASCII characters (i.e. Unicode characters 0 through 255). Otherwise, all Unicode characters should be useable in regular expressions.

Quantified Atom

Function

{n,m}

 Match at least n but not more than m times.

{n,}

 Match at least n times

{n} 

 Match exactly n times.

*

 Match 0 or more times

+

 Match 1 or more times

 ?

 Match 0 or 1 times

 Backslash Character

Function

 \b

Null token matching a word boundary (\w on one side and \W on the other)

 \B

Null token matching a boundary that isn't a word boundary

 \A

Match only at the beginning of a string

 \Z

Match only at the end of a string (or right before a newline at the end)

\n

Newline

\r

Carriage return

 \t

Tab

\f

Form feed

\d

Digit [0-9]

\D

Non- digit [^0-9]

\w

Word character [0-9a-z_A-Z]

\W

Non-word character [^0-9a-z_A-Z]

\s

Whitespace character [ \t\n\r\f]

\S

Non-whitespace character [ ^\t\n\r\f]

\xnn

Hexadecimal character representation

\cD

Match the corresponding control character

\nn or \nnn

Octal character representation, unless a backreference .a \1, \2, \3, etc. match whatever the first, second, third, etc. parenthesized group matched. This is called a backreference. If there is no corresponding group, the number is interpreted as an octal representation of a character.

 \0

matches null character

 

 Any other backslashed character matches itself

By default, a quantified subpattern is greedy . In other words it matches as many times as possible without causing the rest of the pattern not to match. To change the quantifiers to match the minimum number of times possible, without causing the rest of the pattern not to match, you may use a "?" right after the quantifier.

Wildcard

Function

 *?

Match 0 or more times

+?

Match 1 or more times

 ??

Match 0 or 1 time

 {n}?

Match exactly n times

 {n,}?

Match at least n times

 {n,m}?

Match at least n but not more than m times.

 Perl5 extended regular expressions are fully supported.

 (?#text)

 An embedded comment causing text to be ignored.

(?:regexp)

 Groups things like "()" but doesn't cause the group match to be saved.

(?=regexp)

 A zero-width positive lookahead assertion. For example, \w+(?=\s) matches a word followed by whitespace, without including whitespace in the MatchResult.

(?!regexp)

 A zero-width negative lookahead assertion. For example foo(?!bar) matches any occurrence of "foo" that isn't followed by "bar". Remember that this is a zero-width assertion, which means that a(?!b)d will match ad because a is followed by a character that is not b (the d) and a d follows the zero-width assertion.

(?imsx)

One or more embedded pattern-match modifiers. i enables case insensitivity, m enables multiline treatment of the input, s enables single line treatment of the input, and x enables extended whitespace comments.

Repeating the search

To repeat the last search, press F3. This will select the next matched element (until the last one is found) in the diagram. Re-invoking either dialog begins a new search.

See also:

Reference: Keyboard Shortcuts