Re: filtering out text in a string
| From: | Jason Davidson | Date: | Sat, 18 Sep 2004 18:56:57 +0000 |
| Subject: | Re: filtering out text in a string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-197117@lists.php.net to get a copy of this message | ||
Search preg_replace or preg_match in the manual.
Jason
Merlin <news.groups@web.de> wrote:
>
> Hi there,
>
> I want to filter out ip adresses out of a given text string. They are inside a
> logfile and values are seperated by tabs. I tryed sub_str which works fine if
> you know the length of the characters. In case of the ip adress this is not the
> case, since they are sometimes shorter than others.
> Has anybody an idea how to filter the ip adress out? Maybe magically with any
> regex or somehow with tab recognicion.
>
> This is an example of parts of the text
> 20:03:20 [MSG] 192.168.0.129 bla bla
>
> I am stuck here, maybe someone has a good idea or knows how to do that.
>
> Thank you in advance,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>