Function matchGroup( str, regex )
- Description:
-
Returns the first grouped expression matched in a string defined
by a regular expression. A grouped expression is one enclosed
in parentheses.
- Parameters:
-
- str (String)
- string to match against
- regex (String)
- regular expression containing a grouped section
- Return Value (String):
- contents of the matched group
(or null, if
regex
didn't match str
)
- Example:
matchGroup("NGC28948b","NGC([0-9]*)") = "28948"
- Signature:
- String matchGroup(String, String)