I am grouping records (tasks) that have an identifier code.
The code is unique, but there are tasks that are a continuation of others and this is reflected in its code. For example:
- 12345: Original record
- 12345A: New version of register 12345
- 12345B: Another version of register 12345
- 12345C: Third version of register 12345
And here comes my problem:
- 12345CONT: Continuation (of the active version) of 12345 (it does not matter if the active one is the original or A, B or C)
- 12345CONT2: Second continuation of 12345
- 12345PF: Final Information
- ... (other endings, always more than one letter
I want to capture the following groups:
ID - Versión (A,B,C,D -opcional-) - Tipo de tarea (CONT<n>, PF<n>, ...)
My regex is currently the following:
(\d+)[ABCD]?(CONT\d?|PF\d?|REV|REP)?
But it has the problem that 12345CONT
it captures 12345 - C
me and discards the ONT
. I'm looking at "look-ahead" options, but I haven't quite found the solution.
How to capture CONT and C separately?