I have the following RegExp pattern :
A\.B\.(.+?)\.(\d{3}) (.*)
If I test the following string :
A.B.Prop.001 Blabla
Then I obtain the right values :
Match 1
Submatch 1 : Prop
Submatch 2 : 001
Submatch 3 : Blabla
Now I test the following string :
A.B.Prop.001 Blabla A.B.Desc.032 Blablabla
Then I obtain
Match 1
Submatch 1 : Prop
Submatch 2 : 001
Submatch 3 : Blabla A.B.Desc.032 Blablabla
I obtain only one match, I guess this is because the last (.*) in the pattern is greedy so I replace it with a reluctant option :
A\.B\.(.+?)\.(\d{3}) (.*?)
and I test again the latest complete string. Now this is what I obtain :
Match 1
Submatch 1 : Prop
Submatch 2 : 001
Submatch 3 :
Match 2
Submatch 1 : Desc
Submatch 2 : 032
Submatch 3 :
Submatch nr 3 is empty for the two matches. Can any one explain ? Thank you