Scope of $regexp Variables

For the life of me I cannot find out how to utilize (if at all) regexp variables beyond the expression
in the overall expression...i.e. extended scope ??

OK..what I am doing is"Format value" of a $regexp expression to a TEMP tag...
then I USE this TEMP in a 2nd action point.

e.g. in the %title% tag is a date which I wish to save to %RELEASETIME% BUT ONLY if I CAN find it !!

SO Action Point 1 Format Value to TEMP

and pulling from TEMP in the next Action to RELEASETIME

CAN I somehow merge these two into 1 statement easily..i.e. DIRECT to RELEASETIME.

I use variables PreText, PostText and MyDate as I REPEAT this structure in other extracts.


If you use the same data (contents) in various contexts, you could create actions first that set this data to user-defined fields (a sort of variable declaration).
You then re-assemble the other data from these declaration fields.

Many thanks for your reply...perhaps an example might help :wink:

The whole point of the question was to INQUIRE on the possibility of using VARIABLES WITHIN ONE statement ??

I doubt that. Any variable only lives within the current function.

Example: you have your string
Create an action that fills the user-defined tag-fields PRETEXT, POSTTEXT, MYDATE
(e.g. "Guess values" or whatever. Depends)
Then use the tag-fields as you need them
Finally, delete them, when you don't need them anymore.

Yes...OK..that's what I was doing anyway with TEMP...

I had a further look and there 'could' be an alternative though haven't seen any examples in here and that is to use conditionals within the regex statement..

Basically if I DO find a date then load that date into MyDate otherwise load a null string into MyDate...

Now I have seen that the syntax is something like (?(A)X|Y)...

But to be quite honest I haven't a clue how I could use this syntax...

TEMP <== $regexp(%TITLE%,'.*(\d\d\d\d-\d\d-\d\d).*','$1') RELEASETIME <== $if($eql(%TITLE%,$regexp(%TITLE%,'.*(\d\d\d\d-\d\d-\d\d).*','$1')),,$regexp(%TITLE%,'.*(\d\d\d\d-\d\d-\d\d).*','$1'))

If the function $regexp() does not match, then the function returns the unchanged input string.


Yeah...thanks...I think the conditional test with 2 regexp statements has some angles...