Can my $regexp() code be made any better?

I was wondering if my code can be streamlined any more than it is. Quick background:

  • I'm writing actions to read and write cuesheet <-> tags. My current, albeit unfinished, code works, so if nothing changes, that's 100% Ok. I'm just looking to learn 8^)

I notice that when I use, for example, $regexp(%TAG%,'(string)', $1), if the string isn't found, the action returns TAG in full. So, when I search for a string to pull a piece of info for tag, I do this:

Field: DUMMY
Format: $regexp(%CUESHEET2%,'.*?REM BOXSETYEAR "(.+?)".+',$1)
Field: BOXSETYEAR
Format: $if($eql(%DUMMY%,%CUESHEET2%),,%DUMMY%)

Like I said, the code does what I want, so it doesn't need to change. But is there any way to make it more efficient?

If you've read this far, thank you kindly for your time 8^)

You could try a different action type: Import tag fields
Source string: %cuesheet2%
Import pattern: %dummy%REM BOXSETYEAR "%boxsetyear%" %dummy%

Hah! That's how you use that action. That streamlines things considerably, thank you kindly.