First, let me say that this is one of the best explanations of a regex that I have seen.
Now, can anyone give a good example of 1 or 2 lines that would match and 1 or 2 that would NOT match?
Allow me to reword and provide a possible match example:
Match a line with at least one underscore (if more than one, the following applies ONLY to the LAST underscore) that is both preceeded AND followed by at least one character.
Match: I_love
Match: I_love_perl
Match: I_love_perl_!
No Match: I_love_perl!_
Am I right?
-
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.
|