Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58291
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-11-01 14:33 -0700 |
| Message-ID | <f241bc01-d10a-433f-b3af-b22d05a603d8@googlegroups.com> (permalink) |
| Subject | New to using re. Search for a number before a string. |
| From | Captain Dunsel <jonathan.nyquist@gmail.com> |
I have a text file that has lines with numbers occasionally appearing right before a person's name. For example: COLLEGE:ENROLLMENT:COMPLETED EVALUATIONS:624309FUDD, ELMER where I want to search for the name "ELMER FUDD" and extract the number right in front of it "608309" when such a number appears but the length of the number is variable and using ?<= in a regular expression will only search for a fixed length. Any ideas appreciated!
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
New to using re. Search for a number before a string. Captain Dunsel <jonathan.nyquist@gmail.com> - 2013-11-01 14:33 -0700
Re: New to using re. Search for a number before a string. MRAB <python@mrabarnett.plus.com> - 2013-11-01 21:40 +0000
Re: New to using re. Search for a number before a string. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-11-02 09:06 +0200
Re: New to using re. Search for a number before a string. Justin Barber <jbarber@iliff.edu> - 2013-11-02 06:03 -0700
Re: New to using re. Search for a number before a string. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-02 13:31 +0000
Re: New to using re. Search for a number before a string. Captain Dunsel <jonathan.nyquist@gmail.com> - 2013-11-02 17:19 -0700
Re: New to using re. Search for a number before a string. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-03 00:27 +0000
csiph-web