DB<1> $a="abcdabcd"
DB<2> p $a =~ /[0-9a-f]{4|8}/
DB<3> p $a =~ /[0-9a-f]{4}/
1
DB<4> p $a =~ /[0-9a-f]{8}/
1
NB-the display is eating the [] square brackets up there.
lots can follow from this:
- why no error on the 1st line
- am I really the 1st ? ;-)
- whats it mean currently ? (this I can answer)
1: BRANCH(15)
2: ANYOF[0-9a-f](13)
13: EXACT <{4>(18)
15: BRANCH(18)
16: EXACT <8}>(18)
18: END(0)
thats not what I expected, wouldnt you tacitly expect
perl to do something similar to what it does with
{4,8} there ? or is that ambiguous ?
given the availability of \, which is needed to get literal reading of []() chars, whats the harm ?
(He baits the hook, chum the water... Dont we have some regex-monsters lurking here ?
Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|