Re: Can perl find strings over multiple lines?

V

Vronans

Paul said:
Yes, it is.


Yes, it is.

If you would like assistance with the demonstration of such abilities,
please read and follow the Posting Guidelines for the group. Most
specifically, please post your best attempt to solve the problem
you're having, along with a description of how your attempt is not
working sufficiently. Be sure to include example input, desired
output, and actual output.

While it's always good for one to attempt to solve their own problem, I
don't see why the assumption is often made that they did not do so.
Further more, why are some people so concerned with that in the first
place? Especially for a potentially simple answer in this case.

He gave a description of what he was trying to do. You could of included
an answer similar like mine )below) instead of just general guidelines
and leave it at that. Do not get me wrong, your guidelines are good for
general purposes, but by themselves do not really offer anything to the
topic it self.



It sounds to me like he could find the 's' modifier for a regex match,
which cause the '.' meta char to match embedded new lines.

This should to do what the OP wants (un tested):

@matches = $full_text =~ m!--(.*?)\)\$!sg;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top