Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if I could get you guys to help me out with a problem that I am having. I need to parse out one lease from a file that looks like this:
I just cant seem to write a working regular expression to parse this out. Thus far I have lease /$search {.+?}/ but it doesn't worklease 10.2.56.40 { starts 3 2003/08/20 10:37:28; ends 3 2003/08/20 22:37:28; hardware ethernet 00:20:af:52:12:0f; uid 01:20:af:52:12:0f; client-hostname "Telephone"; } lease 10.2.56.75 { starts 3 2003/08/20 09:57:11; ends 3 2003/08/20 21:57:11; hardware ethernet 00:ef:18:ae:52:83; uid 01:00:ef:18:ae:52:83; client-hostname "beast"; } lease 10.2.56.77 { starts 2 2003/08/19 21:13:05; ends 3 2003/08/20 21:13:05; hardware ethernet 00:02:95:9b:78:18; uid 01:02:0b:95:9b:78:18; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: newb regular expression question
by dreadpiratepeter (Priest) on Aug 20, 2003 at 15:24 UTC | |
by ChrisS (Monk) on Aug 20, 2003 at 15:36 UTC | |
|
Re: newb regular expression question
by broquaint (Abbot) on Aug 20, 2003 at 15:33 UTC | |
|
Re: newb regular expression question
by CombatSquirrel (Hermit) on Aug 20, 2003 at 15:32 UTC | |
|
Re: newb regular expression question
by Limbic~Region (Chancellor) on Aug 20, 2003 at 15:32 UTC | |
|
Re: newb regular expression question
by Mr. Muskrat (Canon) on Aug 20, 2003 at 15:34 UTC | |
|
Re: newb regular expression question
by dragonchild (Archbishop) on Aug 20, 2003 at 15:38 UTC | |
|
Re: newb regular expression question
by Theo (Priest) on Aug 21, 2003 at 15:10 UTC |