This function is used to search through an array of strings for occurrences of an regular expression.
str = ["Foo", "Bar", "FooBar"; "sthElse", "1234", "text"]; idx = util.regexStr(str, "\d+") idx = 2×3 logical array 0 0 0 0 1 0 match = str(idx)
Using just the regexp function (res = regexp(str, expr, ignorecase, "once")) would return a cell array:
regexp
res = regexp(str, expr, ignorecase, "once")
res = 2×3 cell array {0×0 double} {0×0 double} {0×0 double} {0×0 double} {[ 1]} {0×0 double}
There was an error while loading. Please reload this page.