in reply to how to make // not return what is in a parenthesis?
And, your code would not produce the output you assert even were those errors corrected. Perhaps the most trivial issue is that your line four would print a dot between the value of $_ and the newline, since you've quoted the entire output, not just the \n. But frankly, I can't even think of a way, off-hand, that any plausible typo in your posting would produce the alleged output
Based on your comments, I'm guessing that you believed the vertical_bar amounts to an or in your regex. It can represent "or" but not in the manner you've presented it. perldoc perlretut may help you on that.
An alternate might be that the bar is a typo for the numeral, "1." but even that would never cause the code you've presented to produce the output you posted.
What you've presented asks the regex engine to match:
a single character, "A"So what did you really mean? What code (if any) actually produced the output you quote?
a string, "BC|" (which is to be captured)
followed by a "D"
as many times as possible
(which is none, nil, never.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to make // not return what is in a parenthesis?
by AnomalousMonk (Archbishop) on Aug 01, 2010 at 02:54 UTC |