-
Notifications
You must be signed in to change notification settings - Fork 0
RegEx
14paxton edited this page Aug 6, 2023
·
3 revisions
title: RegEx permalink: GroovyNotes/RegEx category: GroovyNotes parent: GroovyNotes layout: default has_children: false share: true shortRepo:
- groovynotes
- default
Table of contents
{: .text-delta } 1. TOC {:toc}=~ will look for partial match ==~ look for an exact match
"LBlsBF4wUp".replaceAll(/[\d\sa-zA-Z.!?\-\']/)


def replacedTxt = txt.replaceAll(/.*(\d{2}-\d{2}-\d{4}).*(Gr.*)./) { all, date, lang ->
def dateObj = Date.parse('dd-MM-yyyy', date)
"The text '$all' was created with $lang on a ${dateObj.format('EEEE')}."
}