Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
The "match" function returns a result in ( ).
I would have liked to use the value returned by "match" as an index, but if I try to assign the "match" result to a variable, the variable is flagged as "undifined" when called further down the road.
"Help" is not much help on that.
Is there a way to make usage of the (value) returned by "match", or can this function be used for informational purpose only?
Thank you.
Solved! Go to Solution.
Yes, write match(z)[0
See if that works.
Mike
Mike Armstrong wrote:
Yes, write match(z)[0
See if that works.
Mike
with the caveat that this will return the first match - it may be worth checking if there are other values in match.
Stuart
Good point, but Laurent did say value.
Mike
monotonous set of data......so in my case [1 works great.
I guess the answer would have been obvious to me if there had been multiple matches......
Many thanks.
Maybe, match returns a vector even if only one match is found.
Mike
LIke below if you have a single match.
Mike