Quite a simple scenario...
$regexp('This is Track 16 from the album','^(?:.)(??)$',$+{Track})
Returns 16
$num($regexp('This is Track 16 from the album','^(?:.)(??)$',$+{Track}),3)
Returns 016
However,
$regexp('This is Track 16 from the album','^(?:.)(??)$',$num($+{Track},3))
Returns 000
Is there a conversion of the contained group (i.e.
Tried a few things (using $kleft, $trim) but to no avail ??
General question: What are the limitations of functions within $Regexp
Cheers,
Desmond.
This works ...
$regexp('This is Track 16 from the album','^.*Track (\d{2}).*$','$1')
>> Returns 16
$num($regexp('This is Track 16 from the album','^.*Track (\d{2}).*$','$1'),3)
>> Returns 016
The Mp3tag regexp implementation makes use of the "boost.regex" machine.
http://www.boost.org/doc/libs/1_55_0/libs/...gex/syntax.html
When using the Mp3tag function $regexp() there seems to be no way to use Mp3tag scripting functions in the replacement part.
When using the action "Replace using Regular Expression" there is allowed to use other Mp3tag scripting functions in the replacement part, but I do not know whether this is valid for all Mptag scripting functions, however $num() should work.
When using the Mp3tag function $regexp() it is possible to assemble the expression part from constant text and function output, however this works ...
$regexp('This is Track 16 from the album',
'^(?:.*)(?<'$upper('Track')'>\d{2})(.*?)$','$+{TRACK}')
>> Returns 16
$regexp('This is Track 16 from the album',
'^(?:.*)(?<'$regexp('Track','.*','\U$0')'>\d{2})(.*?)$','$+{TRACK}')
>> Returns 16
DD.20140602.2016.CEST
Many thanks for the clarification...