Compiles and evaluates the specified regular expression against this string.
Compiles and evaluates the specified regular expression against this string.
This method is useful when extracting simple types (that is, types that have a GroupDecoder) from groups rather than entire matches.
For example, imagine that we have the following regular expression: \[(\d+)\]
. Each match will contain the
wrapping brackets - [123]
, for example. In order to only extract information from the first group rather
than the entire match, one would write:
str.evalRegex[Int]("\\[(\\d+)\\]", 1)
regular expression to compile and evaluate.
index of the group from which to extract data in each match.
Compiles and evaluates the specified regular expression against this string.
Shorthand for Regex.eval.
Unsafe version of evalRegex[A](expr:String,group:Int)* .
Unsafe version of evalRegex[A](expr:String)* .
Enriches
String
with useful regex-related syntax.