in reply to Re: Pattern matching
in thread Pattern matching

The code was not working as it was matching patterns with "lds" in them as well

Replies are listed 'Best First'.
Re^3: Pattern matching
by aquarium (Curate) on Dec 29, 2004 at 12:35 UTC
    it was matching because you used .* as a greedy match, which swallowed up any string including "lds", then (correctly) matched following characters as not containing "lds" etc. try changing the greedy .* to the non-greedy version .*?
    the hardest line to type correctly is: stty erase ^H