in reply to Regular Expressions: Call for Examples
I use it as an example when peope ask me what /x is for, and when they ask what *? means.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;
(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.)
|
---|