Re: regex question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Joseph L. Casale wrote:
> Hey guys,
> I am trying to extract a pattern from a downloaded html file. I only want
> the first match
> printed, problem is I don't know how to force sed to exit after printing
> the first match of
> a capture group. Anyone know the trick to manipulating {p;q;} to print a
> capture group?
>
awk '{if ( $0 ~ /p;q;/ ) { print $0; exit;}}' filename

would work....

       mark "if Larry Wall could push perl in comp.lang.awk,
               I can answer a sed question this way...."

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux