this is from 180953 .. it pulls out
IMDB movie titles from the genre file...
next unless m{
^\> \s+ # starts with "> "
(.*? # main part of title ($1 = title)
\((\d+)(/.*?)?\) # year inside parens, might be (1999/I)
# ($2 = year, $3 = crap)
(\s+\(.*?\))? # ($4 = crap .. movies might be tv/vids/games)
)\t+Sci\-Fi$ # must end in Sc-Fi
}x;
I use it as an example when peope ask me what /x is for,
and when they ask what *? means.
(It could also be a good example of non-capturing
parens -- if it was changed to acctualy use them --
I sometimes prefer to capture and ignore unless needed
... one mans crap, is another mans treasure.)
-
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.
|