Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • by vsergu (505) on 2002.11.21 14:51 (#14894) Journal

    my @tokens = m/(\"[\s\S]+\"|\S+)/g;

    Shouldn't that regex be m/(\"[^"]+\"|\S+)/g ? Or as I'd normally write it, /("[^"]+"|\S+)/g . The string might include two quoted phrases.

    • thats a very good point.

      The second regex would do very nicely


      @JAPH = qw(Hacker Perl Another Just);
      print reverse @JAPH;