how to pass default value if regex is not found

Hi,
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: https://gatling.io/docs/gatling/reference/current/http/check/#transforming

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

case None => SOME_DEFAULT_VALUE
case some => some
}.saveas(cor_abc),

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

Implementing this built-in would be an easy contribution: https://github.com/gatling/gatling/issues/4114