in reply to What does this regex do?
Approximation: it captures single lines that do not contain @, and multiple lines (if possible) containing patterns that start and end with @.
Not that it helps much, but here it is in action. Anyone have ideas on what it's trying to find?
and the output is:#! /usr/bin/perl use strict; use warnings; my $file = do {local $/, <DATA>}; my @cvs = $file =~ /((?:(?:[^\n@]+|@[^@]*@)\n?)+)/gs; print "matched [[$_]]\n" for @cvs; __DATA__ line 1 line 2 line 3 longer @line@ with @some stuff@ line with nothing on it line 4
matched [[line 1 line 2 line 3 longer @line@ with @some stuff@ line with nothing on it ]] matched [[line 4 ]]
pbeckingham - typist, perishable vertebrate.
|
---|
In Section
Seekers of Perl Wisdom