
I would like know if I use regex to do this I will have improvement in performance of my system, or I will have delay in my system?
My regex to validate this message is: "\\d{1,5};1;\\d{1,8};\\d{16};\\d{3};\\d{4};\\d{1,8};([0-9]|10|11|12);[012]"
My code sample (in old version I need same about 300 lines to do the same):
Well it probably depends on the quality of your existing code :-) You shouldn't see any noticable slow down, especially if you re-use match_results structures: almost all the overhead is in allocating memory for the array of results, so as long as you re-use the match_results structure it should be pretty quick. I had a quick look at your regular expression and that looks as good as it's going to get as well. The short answer though is to try it out :-) Regards, John.