For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > October 2004 > long lines









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author long lines
Xenos

2004-10-28, 3:59 pm

Hi. Is there a way to continue very long reg. ex. lines on mutliple lines?
I tried using a backslash at the end of line which works in other languages,
but Perl seemed to treat the escaped newline as part of the expression. I
have some very complex reg. ex. that span many columns that I would like to
break up across multiple lines for readability. Is there a way to do this?


Thanks,

DrX


Gunnar Hjalmarsson

2004-10-28, 3:59 pm

Xenos wrote:
> Hi. Is there a way to continue very long reg. ex. lines on mutliple
> lines? I tried using a backslash at the end of line which works in
> other languages, but Perl seemed to treat the escaped newline as part
> of the expression. I have some very complex reg. ex. that span many
> columns that I would like to break up across multiple lines for
> readability. Is there a way to do this?


That's what the /x modifier is for.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com