//ERDDAP/com.cohort.util/ScriptString2/extractCaptureGroup
extractCaptureGroup
[JVM]
open fun extractCaptureGroup(s: String, regex: String, captureGroupNumber: Int): String
This returns the specified capture group from s.
Return
the value of the specified capture group in the first match of the regex, or null if the s doesn't match the regex
Parameters
JVM
s | the source String |
regex | the regular expression, see java.util.regex.Pattern, which matches part of s. |
captureGroupNumber | the number of the capture group (0 for entire regex, 1 for first capture group, 2 for second, etc.) |
Throws
RuntimeException | if trouble, e.g., invalid regex syntax |