Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20510 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2012-02-16 21:32 +1100 |
| Last post | 2012-02-16 21:32 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Reading sub-string from a file Chris Angelico <rosuav@gmail.com> - 2012-02-16 21:32 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-02-16 21:32 +1100 |
| Subject | Re: Reading sub-string from a file |
| Message-ID | <mailman.5884.1329388334.27778.python-list@python.org> |
On Thu, Feb 16, 2012 at 8:52 PM, Smiley 4321 <ssmile03@gmail.com> wrote: > int Jockey_Apple_cat_1KK(float, int, char, int); > int Jockey_Apple_cat_look(int, float, int, int); > int Jockey_Apple_cat_test_ki21es(int, int, int, int); > int Jockey_Apple_cat_tarLK12OU(void, int, int, int); > --- > > Here substring "Jockey_Apple_cat" is common from 3rd line onwards as a > function name. I wish to extract ONLY that function name which has > 'Jockey_Apple_cat' as a substring and ignore remaining function names. Try this: grep -o 'Jockey_Apple_cat[^(]*' test.conf It's not Python, but it might serve you better than knocking something together! But if you're using this to learn Python, Peter Otten's solution is, I think, what you want. ChrisA
Back to top | Article view | comp.lang.python
csiph-web