Re: Regex Help
- From: smallpond <smallpond@xxxxxxxx>
- Date: Mon, 29 Oct 2007 11:58:49 -0700
On Oct 29, 2:14 pm, "inderpau...@xxxxxxxxx" <inderpau...@xxxxxxxxx>
wrote:
I'm a newbie to perl expression more or less. What I want to do is to
use a regex pattern to find the presence of an IP address within a
file or string.
I found this example on the net for a pattern.... \b\d{1,3}\.\d{1,3}\.
\d{1,3}\.\d{1,3}\b
but reading on the \b means a word boundary but does it matter that I
want to find the pattern matching an IP address since the IP address
is made up of characters which are numeric and separated by a
decimal ?
Any further explanation of the above solution I have found would be
appreciated. Any other alternative solution would be appreciated.
Many thanks
Victor
The pattern above will match "255.255.255.255"
but not match "foo255.255.255.255" or "255.255.255.255foo"
because those don't have word boundaries at both ends.
--S
.
- References:
- Regex Help
- From: inderpaul_s@xxxxxxxxx
- Regex Help
- Prev by Date: Regex Help
- Next by Date: FAQ 8.27 What's wrong with using backticks in a void context?
- Previous by thread: Regex Help
- Next by thread: Re: Regex Help
- Index(es):
Relevant Pages
|