decorative banner

Using back-references in wildcard searches


    Back-references let you replace a selection with part of the wildcard string you entered in the Find text box. A back-reference consists of a backslash character followed by a number, for example "\1", "\2", and so on. The number refers to a subexpression (enclosed in parentheses) of the wildcard search pattern in the Find text box:

    • "\1" refers to the first subexpression in the wildcard search pattern. This subexpression starts at the first opening bracket from the left and ends with the complementary closing bracket.
    • "\2" refers to the second subexpression, which starts at the second opening bracket from the left and ends with the complementary closing bracket.

    When you click the Replace button, each selection is replaced with the part of the matching text that has been recognized by the subexpression that the back-reference refers to.

    For example, you enter the wildcard search pattern ((Adobe)?GoLive) in the Find text box to find any occurrence of "GoLive" or "GoLive". The "?" character makes the "Adobe" enclosed in the second pair of parentheses optional. If you enter the back-reference \1 6.0 in the Replace text box, the found text is replaced with the contents of the first pair of parentheses plus the number 6.0. If the match is "Adobe GoLive", the result is GoLive 6.0. If the match is "GoLive", the result is GoLive 6.0.