Regex pattern Kotlin
${month}
is equal to (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)
So the String """\d{2} ${month} \d{4}"""
is actually expanded to
"""\d{2} (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \d{4}"""
This a regex that captures a pair of numbers, followed by a space, then one of the values JAN, FEB... DEC
, followed by another space and four more digits.
So Strings like 04 APR 1234
match the regex.