[oak perl] Regex Practices #1: separate lines?

Tony Stubblebine tonys at oreillynet.com
Tue Mar 16 11:02:29 CST 2004


Only if each line is commented. I have trouble reading if there's too 
much whitespace.

George Woolley wrote:

>Tony,
>
>When writing very simple regular expressions like
>      ^key=
>      :$
>do you recommend using several lines?
>
>Example:
>   if ( $line =~ m/
>                      ^
>                      key=
>
>                /x ) {
>      # ...
>   }
>
>Example:
>   if ( $line !~ m/
>
>                      :
>                      $
>                /x ) {
>   }
>
>George
>
>_______________________________________________
>Oakland mailing list
>Oakland at mail.pm.org
>http://mail.pm.org/mailman/listinfo/oakland
>  
>




More information about the Oakland mailing list