Re: Regexp help in getting the IP address
Schamil Wackenhut <[email protected]> Wed, 11 Jun 2003 10:31:16 +0200
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Message-ID | <20030611083138.GA18102@fuckup> |
* Schamil Wackenhut meinte:
> * Sarika Inamdar meinte:
>
> > Threshold12310.77.11.922003-06-05T06:20:00.171Z.
> > ...
> > Threshold\d+([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})\d{4}-.*
> >
> > This is extracting me the following :
> >
> > 310.77.11.92
>
> Try this:
> Threshold\d{3}([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.
> ([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\d{4}-.*
I forgot the parenthesis around the main expression:
Threshold\d{3}(([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.
([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]))\d{4}-.*
--
You know my name - look up my number. (The Beatles)