Re: regex back matching



In article <Xns9AB467348BD9Fasu1cornelledu@xxxxxxxxx>, A. Sinan Unur
<1usa@xxxxxxxxxxxxxxxxxxx> wrote:

Ray Muforosky <muforo@xxxxxxxxx> wrote in news:8566add6-1bfc-4231-8242-
ba9790cf376f@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

On Jun 5, 8:14 am, Dan Rumney <danrum...@xxxxxxxxxxxxxxxx> wrote:
Ray Muforosky wrote:
Hello

I need to match on lines where the 4 quadrant of the ip is even with
one line regex.

  [snip]

What do you have so far? There are plenty of pages outlinging regexps
for matching IP addresses... that should prove a good start for you

egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
filename

What is egrep?

egrep is a version of the Unix grep program that does regular
expressions.

$ man egrep

"GREP(1)
NAME
grep, egrep, fgrep - print lines matching a pattern

SYNOPSIS
grep [options] PATTERN [FILE...]
grep [options] [-e PATTERN | -f FILE] [FILE...]

DESCRIPTION
Grep searches the named input FILEs (or standard input if no files are
named, or the file name - is given) for lines containing a match to the
given PATTERN. By default, grep prints the matching lines.

In addition, two variant programs egrep and fgrep are available. Egrep
is the same as grep -E. Fgrep is the same as grep -F."


So the OP is asking a question about a Unix utility in a Perl group.

--
Jim Gibson
.



Relevant Pages

  • Re: grep question
    ... > I think -f is a GNU extension for grep and egrep, but it's standard for ... so fgrep may actually be the command he wants. ... On my linux, Barry, grep -f is an alias for fgrep. ...
    (comp.unix.shell)
  • Re: Fraudulent eBay listing
    ... O.K. I had not noticed that you were using plain grep, ... in egrep), * simply stands for "zero or more of the preceding ... Interpret PATTERN as an extended regular expression. ...
    (rec.crafts.metalworking)
  • Re: Python MAPI
    ... registry edits, so I disabled my filters and ran it without. ... egrep - which is a more powerful version of grep; ... "pattrn" which looks in parallel for pattern1, patturn1, ...
    (comp.lang.python)
  • Re: WARNING to potential LINUX users
    ... You're using regular parentheses and not curlies. ... You have to use egrep and not grep for this. ... The main differences between GNU grep and grep found in other varieties are: ... Linux egrep: Matches extended regular expressions ...
    (alt.os.linux.suse)
  • Re: egrep question
    ... The trick to using grep and egrep effectively is to truly understand how pattern ... Tale of Two Cities ... The book titles have spaces, periods, etc. ...
    (AIX-L)