Regexp problem


#1

Can anyone tell me why this Action:

Regular expression "ARTIST": "(.*)" -> "X$1'

turns

a

in to

XaX

rather than in to

Xa

as expected?

I have to use

Regular expression "ARTIST": "^(.*)$" -> "X$1'

to get what I expect.

Thanks.


#2

Because it matches both the presence of the characters and their absence after the string.

You can also use (.+)

Best regards,
Florian


#3

Because it matches both the presence of the characters and their absence after the string.

It should not.

  • is supposed to be greedy, so .* should match only once.