| def dateRegex = $/(?x) # enable whitespace and comments |
| ((?:19|20)\d\d) # year (group 1) (non-capture alternation for century) |
| [- /.] # seperator |
| (0[1-9]|1[012]) # month (group 2) |
| [- /.] # seperator |
| (0[1-9]|[12][0-9]|3[01]) # day (group 3) |
| /$/$ |
| ----- |
| Groovy script |
| Variable definitions |
| Modifiers |
| PsiElement(def)('def') |
| PsiWhiteSpace(' ') |
| Variable |
| PsiElement(identifier)('dateRegex') |
| PsiWhiteSpace(' ') |
| PsiElement(=)('=') |
| PsiWhiteSpace(' ') |
| Multiplicative expression |
| Literal |
| GroovyASTPsiElementImpl($/ regex literal) |
| PsiElement($/ regex begin)('$/') |
| PsiElement($/ regex content)('(?x) # enable whitespace and comments\n((?:19|20)\d\d) # year (group 1) (non-capture alternation for century)\n[- /.] # seperator\n(0[1-9]|1[012]) # month (group 2)\n[- /.] # seperator\n(0[1-9]|[12][0-9]|3[01]) # day (group 3)\n') |
| PsiElement($/ regex end)('/$') |
| PsiElement(/)('/') |
| Reference expression |
| PsiElement(identifier)('$') |