Hi, @kjell-rilbe, @peterjones, @Coises and All,
In my previous post, I said :
I did not need to use the atomic forms *+
I did additional tests and there a difference of execution time between the two solutions : greedy quantifiers vs atomic quantifiers
If I use the same test file , containing 524,288 correct lines, so with 0 match :
line 1 : one;two;three;four;five;six;seven;eight;nine;ten;eleven;twelve;end
line 524288 : one;two;three;four;five;six;seven;eight;nine;ten;eleven;twelve;end
The regex ^[^;\r\n]*(?:;[^;\r\n]*){12}$(*SKIP)(*F)|^.+$ displays the message Mark: 0 matches in entire file after between 1.65s and 1.71s
The regex ^[^;\r\n]*+(?:;[^;\r\n]*+){12}+$(*SKIP)(*F)|^.+ displays the message Mark: 0 matches in entire file after between 1.45s and 1.51s
Now, if I add the six incorrect lines below, at the very end of the test file :
line 524289 : one;two;three;four;five;six;seven;eight;nine;ten;eleven;end
line 524290 : one;two;three;four;five;six;seven;eight;nine;ten;eleven;twelve;thirteen;end
line 524291 : one;two;three;four;five;six;seven;eight;nine;ten;end
line 524292 : one;two;three;four;five;six;seven;eight;nine;ten;eleven;twelve;thirteen;fourteen;end
line 524293 : one
line 524294 : ;two
line 524295 :
The regex ^[^;\r\n]*(?:;[^;\r\n]*){12}$(*SKIP)(*F)|^.+$ displays the message : Mark: 6 matches in entire file after between 1.58s and 1.65s
The regex ^[^;\r\n]*+(?:;[^;\r\n]*+){12}+$(*SKIP)(*F)|^.+ displays the message Mark: 6 matches in entire file after between 1.45s and 1.51s
Remark that, if the Match case option is not checked, the execution time increases significantly ( between 6.1s and 6.2s ) :-((
I repeated each test many times to obtain average values !
Best Regards,
guy038
Of course, the . matches new line option is not cheched and the Wrap around option is checked