I'm doing some transliteration with java and everything works great, but it would be nice to have matched pattern. Is it possible?
For example:
for surname GULEVSKAIA I generate such pattern
(^g+(yu|u|y)l+(io|e|ye|yo|jo|ye)(v|b|w)+(s|c)+(k|c)+a(ya|ia|ja|a|y)(a)*)
can I somehow get information, that actually matched
g
u
l
e
...
etc
As you can see, sometimes it is NOT one letter.
( )in a regex, it defines a "capture group" that you can then query withMatchermethods. See this tutorial: docs.oracle.com/javase/tutorial/essential/regex/groups.html.