need to add slashes
Fairlight
fairlite at fairlite.com
Fri May 26 06:38:50 PDT 2006
The honourable and venerable Kenneth Brody spoke thus:
> >
> > [ * ]<"\">"'"[ * ]
> >
> > Allow 0 or more characters, insert a backslash before any apostrophy,
> > followed by zero or more characters.
>
> No, that's not what it says:
>
> [ * ] - Accept zero or one character. (And, unless you're at EOF,
> it will always accept one character.)
That's not how I interpreted Laura's help files (happened to be on the
system I tested on):
* Accept a single character.
[ A ] Expression A is optional. It may occur zero or more times.
So my [ * ] was actually an attempt to take a single character zero or more
times in advance and retreat of any apostrophe, according to my
interpretation of the docs available. You can see why I was under that
impression, given the verbiage.
> [ * ] - Accept zero or one character.
That's now how I interpreted the combination from the docs, as above.
> You have no repeat loops.
I thought [ * ] was analogous to a RE .* in this context, given the
combination of what I read. And it -is- RE thinking combined with what
I read that led me to this conclusion. In RE, . is match any single
character, a * after anything is accept the previous notation zero or more
times. By the same logic, what I did in the edit should have worked in
theory. :) Either the docs are wrong (doubtful), or my interpretation of
them is wrong (more likely). But now you know why I interpreted them the
way I did.
Which edit still probably would have only handled one. I think I needed a
set of []'s around the whole lot to grab them all if it had worked the way
I thought it did, come to think of it.
> Actually, regular expressions are only pattern matching, aren't they?
> There isn't any "search and replace" in raw RE's.
As far as -raw- RE's, you're correct. But there are really only two
operators you'd use them on: search-and-replace, or match.
mark->
More information about the Filepro-list
mailing list