I have several files with an artist tah of LastName, FirstName's Big Band (or Trio, etc.). Sometimes it's LastName, FirstName MiddleName's Big Band.
I want to reverse First and Last Names, leaving the 's in place.
So I tried to replace artist with $regexp(%artist%,'^(\S+),\s+(.)?(**'**s .)$',$2 $1$3)
How do I escape the single-quote before the s?
When I got tried things that resulted in a valid regexp, it put the single-quote in $2 rather than $3 like I expected. I finally came up with something that worked but I'd like to know for the future what I'm doing wrong
You can try $regexp(%artist%,'^(\S+),\s+(.*)?(''''s.*)'$,$2 $1$3)
It's really a special case and I'm not arguing that this is very straight-forward
By the way: Can you edit your post to enclose the format string in backticks `, e.g., `my format string` so that spaces and other special characters are preserved?