Cecil Westerhof <
Ce...@decebal.nl> wrote:
> When doing:
> regexp -line ${checkLine} ${currentRow} values
>
> This gives a match and fills values.
>
> When I do:
> regexp -line ${checkLine} "${currentRow} 12" values
>
> This does not give a match and it leaves values untouched.
>
> Is this as it should be? I would expect values to be empty.
The operation is implied by the wording of the manpage:
MatchVar will be set to the range of string that matched all of
exp.
Implying that when there is "no match" there is "no set".
In any case, when not using the -inline flag it is better to check the
return value from regex to determine match/no-match states than to look
for the match/submatch vars afterward.