Affects Version/s: None
Fix Version/s: None
Collection implements a method with the following signature:
public Object findResult(Closure closure)
It would be nice if a similar method existed for String.
public Object findResult(Pattern pattern, Closure closure)
The method find() almost performs the same function except that it converts the result to a string, even if it's null or a Boolean. Alternatively, the existing find() methods could be changed to return Object instead of String. Without this method, the matching string has to be saved into a temporary variable and then processed afterwards.
if (new File("file").text.findResult(~/VAR\s*=\s*(\S+)/)
|Workflow||jira [ 12971805 ]||Default workflow, editable Closed status [ 12979611 ]|
|Project Import||Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]|
|Workflow||jira [ 12734340 ]||Default workflow, editable Closed status [ 12746089 ]|
|Project Import||Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Field||Original Value||New Value|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Duplicate [ 3 ]|