2

I am using the following expression:

Find what: [0-9]

But what should I write in Replace with field if I want to add specific sup tag to all the digits?

Thanks in advance!

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563

1 Answers1

4

The replacement can be

<sup>$0</sup>

or

<sup>$&</sup>

Note that the $0 / ${0} / $&, or even $MATCH and ${^MATCH} backrefrence inserts the whole match.

See the Substitutions section:

$&, $MATCH, ${^MATCH}
       The whole matched text.

and

$n, ${n}, \n
      Returns what matched the subexpression numbered n. Negative indices are not alowed.

Note that a match value is usually stored as Group 0 inside a match object.

However, \0 as of now does not work (Notepad++ v.6.9), it looks like it is treated as a NUL character and truncates the replacement pattern right at the location where it is located.

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563