I have the following string
D_Doc Name L_Linked Doc Q_1_5
or
D_Doc Name L_Linked Doc Q_5
I’m having a hard time creating a regex to match the following
Doc Name
Linked Doc
1_5 or 5
D_Doc Name is always present
L_ and Q_ are not
The string may also look like the following
D_Doc Name Doc Q_1_5
D_Doc Name Doc Q_5
D_Doc Name L_Linked Doc
I would like to be able to reference the matches as
match[‘DocName’] or some meaning full way so I know which match is found and which isn’t.
Any suggestions?
If I understand you correctly, the regex you want is something like:
It produces the following results for some test inputs: