in reply to Re: newline in pattern matching
in thread newline in pattern matching

Hi Everyone. I've tried your suggestions (and combos of) and the one that seems to work best is

(/dist:.(\d+)/s)

The only case I haven't gotten this one to work on is:

dist:
45.3 km;

Any suggestions?

I should have mentioned earlier that the number involved is a real number and that I'm reading these numbers from an input data file. Right now, only the integer part of the number is being read. I'm in the process of looking up how to handle that one right now. Thanks again!

Replies are listed 'Best First'.
Re: Re: Re: newline in pattern matching
by graff (Chancellor) on Nov 16, 2002 at 18:18 UTC
    You're really close. Try this:
    ( /dist:.*([\d.]+)/s )
    Note that the period, when inside square brackets, is treated as a literal, not as a wildcard.