Question on TCL regexp and match

Hello everyone,
I'm new in tcl scripting.
I'm currently studying a tcl script and came across this line:

 regexp \{\(\\d\+\)\(\\S?\)\} $opts match opt swi

According to my understanding, this line means to search in the opts variable for one or more digit, followed by a non-whitespace character (if the non-whitespace character exists). The matched pattern will then copied into the opt variable.

Is my understanding is correct?
How about the swi? What does it do?

Please help. Thanks

regexp {(\d+)(\S?)} $opts  match      opt          swi
regexp exp          string ?matchVar? ?subMatchVar subMatchVar ...?

If additional arguments are specified after string then they are treated as the names of variables in which to return information about which part(s) of string matched exp. MatchVar will be set to the range of string that matched all of exp. The first subMatchVar will contain the characters in string that matched the leftmost parenthesized subexpression within exp, the next subMatchVar will contain the characters that matched the next parenthesized subexpression to the right in exp, and so on.
tcl -regexp

Good explanation, thanks spacebar :b: