In article <4%******************@nwrddc02.gnilink.net>,
ju******@hotmail.com says...
Lyn wrote:
[...] It looks like this:
([^"]*)
To me, it looks like 0 or more occurences of the beginning of
a string or quote character, but that doesn't make much sense
in the context it's used. And it's used multiple times, so
I'm hoping it's a widely used trick that someone might be able
to explain to me?
Inside of a character class the caret "^" looses it's special meaning and
does not match beginning of the string any more.
So this RE matches any sequence of consecutive carets and double quotes.
jue
Jue,
Shame on you for this bit of misinformation!
From the "Regular Expression Pocket Reference" by Tony Stubblebine:
"Character classes are ways to define or specify a set of characters.
A character class matches one character in the input string that is
within the defined set.
Normal classes: [...] and [^...]
Character classes, [...], and negated character classes, [^...],
allow you to list the characters that you do or do not want to match.
(More info...)
So this RE, ([^"]*), captures zero or more occurrences of anything that
is not a double-quote. With the parentheses, there is capturing also
into a numbered variable, i.e., $1, $2 depending on how many previous
capturing parenthesis exist. Perhaps a better RE, in my mind, would be
([^"]+), i.e., one or more occurrences of anything not a double-quote.
The asterisk modifier would match zero or more of anything not a double-
quote which may or may not be what you want.
magoo