Digit Following A Parentesis?

Hi,

I can't seem to find a way of having a digit following a parentheses when replacing text. For example I want to use:

$11

I've put them in different colours to show that it should be parentheses number 1 followed by the digit 1. But it is of course parsing it as parentheses 11 instead and I cannot seem to find a way around it.

Thanks for any help.
Jug.

edit: I see a workaround to this is to use an invalid character in-between which it naturally emits. I personally don't find that a very pretty method though.

I do not understand what the problem is and what you want to tell us about this problem.
Please elaborate the problem in other words and give us a real world example of the circumstances.

DD.20091119.0856.CET

I assume he wants to use a "replacement number" directly followed by a digit in a regular expression.
e.g. like this:

$regexp(%_FILENAME%,'(abc)(3)',$10$2)

In his case this should lead to "abc03", but leads to "3" because the $10 will not be interpreted as "$1" followed by a "0" but interpreted as "$10" (tenth parenthesis expression) - which does not exist.

The solution is easy:
use a brace "{" around the "parenthesis number":

$regexp(%_FILENAME%,'(abc)(3)',${1}0$2)

kind regards,
Matthias

This seems to work too ...

$regexp('abc3','(abc)(3)','\10\2')

... which gives "abc03"

DD.20091119.1023.CET

Interesting :wink:
I assume this works because the underlying regex-library does only support 9 backreferences when using "\1" syntax and more of them when using "$1" syntax.

BTW, which regex-library does mp3tag use?

An interesting page about regex in common and different implementations is this one:
www.regular-expressions.info/refreplace.html
Really good page!

kind regards,
Matthias

Ah thanks I will change to the suggested ${1}1 as that seems like better syntax.