Using Regex to verify file exists with a specific format for the name

The following relevance will return true if it locates a file with a name like:
A123456789.svr

exists (find file "*.svr" of folder "/etc") and (exists (parenthesized part 1 of (matches (regex "([A-Za-z][A-Za-z0-9][0-9]{8}).*") of (names of find files "*.svr" of folder "/etc"))) )

if {exists (find file "*.svr" of folder "/etc") and (exists (parenthesized part 1 of (matches (regex "([A-Za-z][A-Za-z0-9][0-9]{8}).*") of (names of find files "*.svr" of folder "/etc"))) ) }
then <this> 
else <that> 
endif

But, when I try to evaluate that relevance in an if statement in Action Script, it errors:
It didn’t look like using two left curly braces would correct this problem.

Any suggestions?

Thanks,
Bob_K

The ActionScript version of ‘if’ does not have a ‘then’ clause. It should just be

if {condition}
  // do things
elseif {other condition}
  // do other things
else 
  // do a third thing if none of the others match
endif

More examples at https://developer.bigfix.com/action-script/reference/flow-control/if-elseif-else-endif.html

I’m sure that you’ll find the solution in this interesting thread that addresses your {8} similar action script issue: