[Philadelphia-pm] Perl one liner, regex capture group problem
Kyle R. Burton
kyle.burton at gmail.com
Fri Oct 28 08:14:56 PDT 2011
> command: curl -so- http://www.wikihow.com/Make-Easy-Homemade-Biscuits|perl
> -nE "say $1 if /src='(\S+(?:png|jpg))'/"
> abbreviated output:
Stan,
You may just be hitting shell replacement since the expression is in
double quotes - try backslashing the $1:
... perl -nE "say \$1 if /src='(\S+(?:png|jpg))'/"
HTH,
Kyle
--
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/
More information about the Philadelphia-pm
mailing list