This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using Matcher object returned by =~ operator | |
matcher = "Hello world v1.01" =~ /.* v(\S*)/ | |
if (matcher.matches()) version = matcher[0][1] | |
assert version == "1.01" | |
// We can make this a little tidier using the 'with' method | |
version = ("Hello world v1.01" =~ /.* v(\S*)/).with { matches() ? it[0][1] : null } | |
assert version == "1.01" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Obtain Token and Invoke Service |