matchvec - returns the current match vector
oadl::matchvec()
The matchvec()
intrinsic returns the current
match vector - the list of collected strings resulting from pattern
matching in the match
statement. The zero'th
element of this vector is the entire matched string. The next
elements of the vector correspond to ?1
,
?2
, and so on.
The matchvec()
call is only valid in the
context of a match
statemen.
The vector of matched strings from a match() statement.
MatchCheck
if
oadl::matchvec()
is called when no
match
statement is active.
match("123 456") { case "([0-9]*) ([0-9]*)" : "Matched! Vec = ", oadl::matchvec(), '\n'; } Matched! Vec = +-------+ 123 456 |123 456| +-------+ "", oadl::matchvec(), '\n'; No active matches