If Regexp matches return 1 otherwise 0 syntax
79 views (last 30 days)
Walter Roberson on 25 Mar 2013
regexp() by default returns a list of indices upon a match, and  if there are no matches. The list of indices will all be non-zero numbers, and "if" applied to an array of non-zero numbers is considered to be true, just as if all() had been applied to the list. "if" applied to the empty matrix is false. So, you do not need to do any conversion: you can just test regexp() result directly.