S
steve
is there a way to quickly tell what portion of a regular expression matched
a string?
ex. ([a-z]{3})|(0-9{2})
if the string is "abc", i'd like to know the that the first parenth matched.
if the string is "18", i'd like to know that the second parent matched.
i'd like to avoid having to test each individual parenth pattern. i know you
can replace using $1, $2, etc. but i don't know of a similar match
interface. i also want to avoid having to name each parenth pattern.
tia,
steve
a string?
ex. ([a-z]{3})|(0-9{2})
if the string is "abc", i'd like to know the that the first parenth matched.
if the string is "18", i'd like to know that the second parent matched.
i'd like to avoid having to test each individual parenth pattern. i know you
can replace using $1, $2, etc. but i don't know of a similar match
interface. i also want to avoid having to name each parenth pattern.
tia,
steve