Use of Wildcard

Tool for Search and Replace across multiple files.
Post Reply
User avatar
Vijay

Use of Wildcard

Post by Vijay »

Hello, i have multiple files having records such as below.
numericInput name="NumericInput5" text1
numericInput name="NumericInput6" text1
numericInput name="NumericInput7" text1

Here, I want to use wild card on number 5,6,7 and so on. Can someone please send me the exact syntax ?

Thanks,
Vijay
User avatar
Fool4UAnyway

Post by Fool4UAnyway »

Well, you more or less almost specified it correctly yourself:

numericInput name="NumericInput\d+" text1

\d = [0-9] = any single digit
+ = any consecutive string of at least one

This matches any positive number. I assume you also want 10 and further to match.
User avatar
Boondoggle

Post by Boondoggle »

How can i replace anything between paranthesis "test(123)" with "test(321)" ?
User avatar
Boondoggle

Post by Boondoggle »

ie im thinking of something like "test(*)" as in DOS
User avatar
Fool4UAnyway

Post by Fool4UAnyway »

Because parentheses have a special meaning, if you want to match the actual characters, you'll have to use an escape character \ in front of them.

Figure out what this does and why.

Find:
test\((\d)(\d)(\d)\)

Replace by:
test($3$2$1)

In the Replace by expression, you can just use the actual characters. You may have found out what $3$2$1 does and also what function the unescaped parentheses perform.
User avatar
Fool4UAnyway

Post by Fool4UAnyway »

"Anything between parentheses"
=
An opening parenthesis
+
Any characters not being the closing parenthesis
+
The closing parenthesis =

\([^\)]*\)
User avatar
Boodoggle

Post by Boodoggle »

Ah! Worked perfectly! Very useful! Thank you! :)
User avatar
Boondoggle

Post by Boondoggle »

hmm might use textcrawler to correct my handle ;)
Post Reply