A short introduction into the syntax of Regular Expression Groups that can be used for very common data transformation tasks. I personally often need them, when I use data from excel and need to extract something and put it into a list of strings, to use it for example in an SQL query like:
select * from MyTable where name in ('A','B','C');
I usually execute them in IntelliJ / DataGrip with `STRG + F` and `STRG + R`. This should open, depending on your defined key mappings a mask like this:
Match text of the whole line from beginning to end
Capture the text of the whole line into a group by adding
() to a segment
Capture the text of the whole line into a named group
Adding multiple brackets into the regex will create multiple capture groups.
Get capture by order
and so on.
Get capture by name
Convert column row entries from Excel to comma-separated strings, for example, to be used for range queries in SQL: