There are five kinds of strings in groovy
Pattern myRegex = ~/regex/
Matcher myMatcher = 'subject' =~ /regex/
Matcher myMatcher = Pattern.compile(/regex/).matcher("subject")
def shoutedWord = ~/\b[A-Z]+\b/
def matcher = ("EUREKA" =~ shoutedWord)
assert matcher.matches()
def numberMatches = "1234" =~ /\d+/
assert numberMatches.matches()
==~
assert "1234" ==~ /\d+/
assert "FOO" ==~ /\d+/
cat text.txt| groovyclient -np -e "line.replaceAll("\a","\A")"
gvcl -pi -e 'line.replaceAll("A","a")' 4.txt