Tcl "seems" to have a new parameter-inline for the regular expression command regexp after the 8.4 version:
-inline Causes the command to return, as a list, the data that would otherwise is placed in match variables. When using the -inline, match variables May is not specified. If used with -all, the list would be concatenated at each iteration, and such that a flat list are always returned. For each match iteration, the command would append the overall match data, plus one element for each subexpression in the R Egular expression. Examples is:
regexp -inline--{\w (\w)} "inlined"
→in n
regexp -all-inline--{\w (\w)} "inlined"
→ In n li I ne E
The return value that is understood to be an expression is no longer 1 (success) or 0 (failed).
Instead of a list, the value of this list is all the content matched by the pattern of the regular expression + the contents of each sub-pattern match (each sub-pattern match result is an element of list);
If the-all parameter is added, the returned list is the content of the result connection (Contat) that all iterations match.
In fact, if-all is not added, it is equivalent to:
RegExp--{\w (\w)} "inlined" Match sub1
Where match is the content of all matches, and Sub1 is the sub-mode content.
The experiment encountered a problem (in fact, it doesn't matter with-inline):
% Set tokenlist_02 {vsb_components_t1 = "Feature_ipnet_inet6 2 feature_snmp_v3 y component_tunnel_support y SNMP[0-9_]+ 1 Feature_snmp_agentx y "}
% Set Token_items [regexp-inline {([^\s\=\]]+) \s*=\s* (. *)} $tokenList _02]
% lindex $token _items 0
VSB_COMPONENTS_T1 = "Feature_ipnet_inet6 2 feature_snmp_v3 y component_tunnel_support y SNMP[0-9_]+ 1 FEATURE_SNMP_ Agentx y "
% lindex $token _items 1
Vsb_components_t1
% lindex $token _items 2
"Feature_ipnet_inet6 2 feature_snmp_v3 y component_tunnel_support y snmp[0-9_]+ 1 feature_snmp_agentx y"
% llength [lindex $token _items 2]
1-------------------------------------------------> How could it be 1, shouldn't it be 10?
In fact, you don't see the double quotes, and the quotation marks make all of the contents an element of the list.
% llength [lindex [lindex $token _items 2] 0]
10
That's the result.