1

When I am trying to search for some word containing caret character ^ in UltraEdit, it is not showing me any searched result. For this I have to search the word with double occurrence of ^^.

Example:

The string to find is Search^This. But I have to search with Search^^This.

Is there any solution so that I don't have to put two ^ characters in search popup text area because some of the variable names in program may contain more than 2 or even more ^ characters.

Mofi
  • 46,139
  • 17
  • 80
  • 143
user3103991
  • 407
  • 1
  • 8
  • 13

2 Answers2

1

The short answer is that ^ has a special meaning in UE's search strings (more details in help). To search for ^ you have to enter ^^.

Mofi
  • 46,139
  • 17
  • 80
  • 143
MBaas
  • 7,248
  • 6
  • 44
  • 61
1

In Find or Replace window (not docked), press key F1 to open help page, or click on button Help (older versions of UltraEdit) in the dialog, or take a look on online help page about Find command for an explanation why ^ must be escaped with an additional ^ to be interpreted as literal character.

The options you have:

  1. On a non regular expression Find/Replace you have to escape each ^ by inserting an additional ^.

  2. On an UltraEdit regular expression Find/Replace you have to escape each ^ by inserting an additional ^ or alternatively use ? for each ^ to match any character except carriage return or line-feed.

  3. Using Unix or Perl regular expression Find/Replace is also of no real help as ^ means beginning of line. So even on a Unix/Perl regular expression Find/Replace you have to escape each ^ by inserting before the escape character \ resulting in \^ to get character ^ interpreted as literal character. Or alternatively you use . for each ^ to match any character except new line characters.

  4. For non/UltraEdit regular expression Finds/Replaces it would be possible at Advanced - Configuration - Search - Miscellaneous to define a different character than ^ as Special character used in find/replace strings. You can use this setting and define for example \ or # as escape character. But make use of that option just for doing the Finds/Replaces on the strings with ^ in file and then change the configuration setting back to ^ as otherwise you will encounter definitely problems in future. Everything written about using UltraEdit or non regular expression Finds/Replaces assumes that ^ is the escape character.

Mofi
  • 46,139
  • 17
  • 80
  • 143