This expression extracts a date (eg. 04.05.2020)
(\d{2}.\d{2}.\d{4})
capture {
digit { exact(2) }
literal('.')
digit { exact(2) }
literal('.')
digit { exact(4) }
}
This expression captures the keys (Z L A R G) and their corresponding values. The keys are translated into human readable language by using the Dictionary.
See a full explanation here: Click
val options: Set<RegexOption> = setOf(RegexOption.MULTILINE)
expression({
start()
nocapture {
literal('*')
capture {
match { string("ZLARG") }
}
match { whitespace() }
capture {
digit { quantity(Q.ONE_OR_MORE) }
or()
word { range(1, 3, ',') }
}
match { whitespace() }
quantity(Q.ZERO_OR_ONE)
capture {
char('R')
digit { exact(6) }
}
quantity(Q.ZERO_OR_ONE)
or()
capture {
start()
digit { exact(7) }
}
}
}, options)