Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • although you have to really search for it.

    String("foo").matches("bar") says that it's equivalent to Pattern.matches("bar","foo"), which is equivalent to Pattern.compile("bar").matcher("foo").matches(); the Pattern.matcher method returns a Matcher object, whose documentation says «The matches method attempts to match the entire input sequence against the pattern» and «The find method scans the input sequence looking for the next subsequence that matches the pattern».

    No, it's not clear, it's not easy to find, but it is there… Python, on the other hand, has a section in the Library Reference clearly titled «Matching vs Searching» where it explains the same thing.