How to Refine RegEx (\bL\s*\d{6}\s*\d{7}\b) -


This is followed by a previous question (). Get the wave / lawn from the target file. It is marked by the pattern of L or 6d / 7d. I wrongly said that there can not be an alpha between kick (305455) and loan (1025446). By the time I applied the proposed Regex, everything was pretty good unless I did not affect this file. Note that '6770G37 has an alpha and broke the pattern or it was 6 digits and restarting the pattern is not sufficient to understand it with Reg X. Here are three different samples that I need to find. Thanks!

  ie 030 66686500 L 305,455 '6770G37 66,686,501 1,025,446' FST 6770G37 66,686,502 O ZCA / 999 66,686,503 H 05 66,686,504  

  I Jigsaw '* Acadiana Airport 29865996 L 300 216' 2425 29,865,997 0,915,302 '2425 29865998 S MSY 29,865,999  

  I JENNA078033' ZFW L 322,823 0,923,754 'ZFW  < / Pre> 

(transferred from deleted answer)

This is followed by Gisu's reply, but the comment area could not be found properly For Rexax L \ s * (\ d {6}) \ s * (?: '. * \ N)? \ S * (\ d {7}) has been proposed , but failed on this method by using a net engine with a multi-line option.

The goal is to capture Latitude 322,441 and longitude 0,994,055

Returned matches:.

 L 322,441 '1325 66,685,780 

Sample Data .....

 I ABI E 018 66685779 L 322 441' 1325 66,685,780 0,994,055 '1325 66685781 O ZCF / 999 66,685,782 H 05 666685783 

Thanks guys again!


This is followed by Gishu's reply, but comment area could not be formatted properly. Rexax L \ s * (\ d {6}) \ s * (?: '. * \ N)? \ S * (\ d {7}) has been proposed , but failed on this method by using a net engine with a multi-line option.

The goal is to capture Latitude 322,441 and longitude 0,994,055

Returned matches:.

 L 322,441 '1325 66,685,780 

Sample Data .....

 Eye AB E 018 66685779 L 322 441' 1325 66,685,780 09 9 4055 '1325 66685781 o ZCF / 99966685782 H 05 66685783 

Thanks again people!

See if it works. L \ s * (\ d {6 }) \ S * (?: '. * \ N)? \ S * (\ d {7})

  string sText = @ "..." // All the different patterns you have posted. I think I have 4 RegEx RegEx = new Regex (@ "L \ s * (\ d {6}) \ s * (?: '. * \ N)? \ S * (\ d {7})" , Regensoption .Multiline); Furachay (Match every match in Reggae Matt's (Testext)) {console. Weidline ("L {0}, {1}", every match, group [1], every match. [2]); }  

Output:

  L-305,455, 1,025,446 TL 300,216, 0,915,302 TL 322,823, 0,923,754 TL 322,441, 0,994,055  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -