How to find multi keys using regex in UltraEdit?

2.3k views Asked by At

I only found I can find A or B in UltraEdit Help, http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regular_expressions.html#or

^{A^}^{B^}  (A|B)   Matches expression A OR B.

Now I want to find A or B or C, how to do?

2

There are 2 answers

0
Monty Wild On BEST ANSWER

Currently UltraEdit only allows for the specification of two operands for an OR expression

In theory, you could nest the expressions:

^{A^}^{^{B^}^{C^}} (A|(B|C)) Matches expression A OR (B OR C)

but as I've never used UltraEdit, you'd have to try it yourself.

0
Mofi On

The legacy UltraEdit and Unix regular expression engines available in UltraEdit support only OR expressions with exactly 2 arguments and nesting them is not possible.

The Perl regular expression engine must be used in UltraEdit if an OR expression is required with more arguments.

Example: string1|string2|string3|string4|...|stringN

Enclosing the OR expression within parentheses needs to be done only if there is a fixed string or expression before and/or after the OR expression.

Example: valign=['"]*(?:bottom|middle|top)['"]*

?: after opening parenthesis declare the group as non marking group which should be always used except the string found by the expression needs to be back referenced either in search string or in the replace string with \1 for first marking group in search string.