in reply to Proper use of //x

Well in a lot of cases //x isn't useful... *but*...
$s =~ /(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA| BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB| CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC)/x;
I've personally had horrendously huge regex's that either were going to be about 3,000 characters on one line or I had to break them up to multiple lines. /x is the only way you can do this without picking up spurious white space and carriage returns and still make things look nice. yes you have to escape any spaces you have, but that's the price you have to pay for readability and maintainability sometimes!

Replies are listed 'Best First'.
Re: Re: Proper use of //x
by Fastolfe (Vicar) on Nov 30, 2000 at 20:16 UTC
    Personally, I find \s works just as nicely as a space, and is far more consistent with other regex symbols. Is that what you meant by "escape any spaces"?