Re: Regex Help



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

.



Relevant Pages

  • Re: Predicting the Future and Kolmogorov Complexity
    ... Predictability is based on the pattern itself. ... addition to the string. ... For any prediction scheme, there are computable strings that show no ... Out of this hole comes a ~2 cm blue marble followed by a red ...
    (talk.origins)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: Entropy in crystalization: up or down?
    ... such a pattern as "artifact" has exactly the same fundamental basis ... for accepting a certain type of narrow band radiosignal as artifact. ... and *that* is the reason that induction on a data string alone is worthless. ... over and over again, in radiosignals. ...
    (talk.origins)
  • Re: Model View Controller basics.
    ... Check into the command pattern: ... > And exactly this the reason for my presence here. ... you can use to write phonebook entries, address cards, etc.. ... > string fname; ...
    (comp.object)