Find&replace, RegEx, \10
-
I want to find&replace using regular expression.
If I put (something) in find and then \number to replace then the text in the bracket won’t be changed. I have 14 brackets in a single command. And when I write \10 to the replace, it return the first bracket and a zero, rather than the stuff in the 10th bracket. -
If I correctly understood your question, just enclose it in brackets, as in
\{10}.Take care and have fun!
-
@astrosofista said in Find&replace, RegEx, \10:
\{10}I don’t think that syntax works??
But this syntax ALWAYS works, in replace:
${1}<-- for group 1
${2}<-- for group 2
…
${N}<-- for group NThus for OP’s specific problem and example -->
${10}in replace field should work. -
I neglected to mention the “group 0” match, which has the same syntax format as the ones I DID mention:
If you happen to need to refer to ALL of the matched text, you can use
${0}to refer to it. -
Yes, my bad, ${10} is the thing.
-
The answers you have received are good.
If you would like more documentation on this, the official Notepad++ docs talk about the substitution expressions here.
Notepad++ uses what’s known as the “Boost engine” (currently v1.70) for handling the regular expressions, and that has its substitution documentation here
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login