Previous

Next


17. Greediness and backtracking - continued

  • The answer is nothing!
  • Remember that "*" can match zero or more times, so it tries to match "[0-9]" zero or more times, and guess what? Zero times works! So it's done right there, and successfully matches nothing (which isn't the same thing as not matching!)
  • There is no matching to the end and backtracking going on. So be careful!

Previous

Next

Andrew Hill

For LinuxSA Meeting, 17 April 2001