Previous

Next


08. Greediness (continued)

  • So, be careful about how that works! If you set your regex to:
      fanta(.*)n
    
    and you expected to get:
      This isn't fantastic, let's drink fanta!
                 ^^^^^^^^^^^^^^^^^^^^^
    
    you'd be caught out, because it would really match:
      This isn't fantastic, let's drink fanta!
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    
  • See the difference?

Previous

Next

Andrew Hill

For LinuxSA Meeting, 17 April 2001