Extracting info from one field to another

Hi everyone,
I'm trying to extract the first four digits from the comment field and copying them into the year field.
Here's an example of the data in the comment field:

PlayoutONE Meta Data,1985,1,0,0,0,0,0

I've tried to create an action:

Format Value
Field: YEAR
Format String: $regexp(%COMMENT%,(\d{4}))

But nothing is happening, I've tried multiple variations.

Source: $regexp(%comment%,(\d{4})
Target string: %comment%==%year%

I'm beginning to feel like I'm banging my head against a wall. I know I'm in the right area, however I think I'm missing the obvious point. Any help would be greatly appreciated.

Regards,

Trev

Try an action of the type "Format value" or Convert>Tag-Tag for YEAR
Format string: $regexp(%comment%,.*(\d\d\d\d).*,$1)

Hi ohrenkino,

It sort of worked, although it only inputs 2024 into the year field. Thanks for the suggestion!

If comment contiains 1985 as in your sample string, then I doubt that the expression will return 2024.
What does the data really look like and which expression did you use to get 2024 and what did you expect to happen?
grafik

What does the extended tags dialogue Alt-T show for that exact file?
I suspect the following:
There are other tag versions in the file like APE
and/or
there is more than 1 comment field in the file.

I see a "2024" further down the comment - and as the real string is much longer and features the pattern of 4 digits in a row several times, it is logical that the applied expression produces unexpected results.

Try
Format string: $regexp(%comment%,.*?(\d\d\d\d).*,$1)

That's got it! Thank you, I've been trying to figure this out all afternoon.