|
Posted by dorayme on 11/09/07 21:07
In article <slrnfj8eoq.vl1.spamspam@bowser.marioworld>,
Ben C <spamspam@spam.eggs> wrote:
> On 2007-11-09, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> > In article <slrnfj859a.vl1.spamspam@bowser.marioworld>,
> > Ben C <spamspam@spam.eggs> wrote:
> >
> >> Ticking a box marked "Use Grep" is ironic since "grep" itself is the
> >> name of a different ed command ("global regular expression print"),
> >> which filters rather than substitutes. It should be called "Use Regex".
> >
> > You referring to the F & R dialog box in BBEdit for Mac?
>
> Yes.
>
> > In a spiel in the supporting files with BBEdit there is a *note*
> > that says:
> >
> > Grep is the name of a frequently used Unix command that searches
> > using regular expressions, the same type of search pattern used
> > by BBEdit. For this reason, you will often see regular
> > expressions called "grep patterns," as BBEdit does. They're the
> > same thing.
>
> Yes, they are the same thing, but I stand by my quibble that "Use Grep"
> is a poor choice of name.
>
O I was not meaning to dispute anything you said... I would
simply not know. (I know how to put in a set of back shocks on a
Ford XY real quick now but...)
> The Unix program grep is named after the ed command. What the ed command
> does is print out each line of the buffer that matches the pattern. The
> grep program does the same: it prints out each line of its input that
> matches the pattern. That's not quite the same as Find as Replace. It's
> more like Find. The thing they have in common is regular expressions, so
> why not call the option that?
>
> Another difficulty is that many of these different programs use slightly
> different regular expression syntax. Does BBEdit really use grep
> patterns? I think it actually uses the PCRE library (perl-compatible
> regular expressions), which are not the same as either grep or egrep
> patterns (although closer to egrep). This is important in the real world
> because it changes what you need to escape. In a grep pattern ? matches
> a ?, and \? means "0 or more". But in an egrep (or PCRE) pattern \?
> matches a ? and ? means "0 or more". It's very annoying when you don't
> know which you're supposed to be using.
>
On this reasoning, it sounds to me that BBEdit is using egrep
because I have to escape the ? to match the ?.
> It would be less confusing to normal people and much less confusing to
> nerds just to call it "use regex".
Well, I was not confused because I am an innocent lamb and
printed out some of the documentation that came with the software
and read it lying back on the enormous bench seat of the XY after
a swim one day at Clovelly Bay. Not that I don't get confused. It
is enormous fun making patterns and watching them work on whole
folders of files. Strange but true for those with the boy in
them. <g>
--
dorayme
Navigation:
[Reply to this message]
|