how to pass default value if regex is not found

I have a regex(abc=(.*?)).findSaveas(cor_abc),
if I run script for user1 it will find the value and saves in cor_abc, for user2 it does not find the value. in this case how to send any default value for user2?

Please advise

Please help, Iam struck in middle of my project.

How to find default value if the regex didnot find value?

You can use transformOption:

regex(abc=(.*?)).transform {

case some => some

Indeed, it would be nice to have a built-in.

Implementing this built-in would be an easy contribution: