http://qs321.pair.com?node_id=526815


in reply to Correct Regex for reading stock symbol?

Removed: I learn something new every day on this site! Thanks to samtregar for today's lesson.

I thought it had something to do with the unescaped period inside the brackets in the regex, but samtregar proved me wrong.

Replies are listed 'Best First'.
Re^2: Correct Regex for reading stock symbol?
by samtregar (Abbot) on Jan 31, 2006 at 17:47 UTC
    Not true. Observe:

    $ perl -e 'print "broken\n" if "foo" =~ /[.]/' $ perl -e 'print "ok\n" if "foo." =~ /[.]/' ok

    The period is not magical inside a character class.

    -sam

Re^2: Correct Regex for reading stock symbol?
by dimar (Curate) on Jan 31, 2006 at 20:18 UTC
    Removed: I learn something new every day on this site!

    Unfortunately, nobody else gets to, because you removed the node instead of updating it. Please consider that next time, so others can get the full context of the thread and benefit in the mutual learning opportunity.


    =oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV