dave_pl has asked for the wisdom of the Perl Monks concerning the following question:

Loa Monks

I need some wisdom please, this is not Perl just regex
Here is what i have:

[A-Za-z0-9]{1}<br>


is there a better way of doing this?

I thank you in advance for your help!

Replies are listed 'Best First'.
Re: regex prob
by Joost (Canon) on May 12, 2005 at 18:03 UTC
Re: regex prob
by Fletch (Bishop) on May 12, 2005 at 18:05 UTC

    Perhaps if you explained what the frell you were trying to do with this someone might could give you an answer (well besides telling you that {1} is pretty much superfluous as the character class by definition will match exactly one of any of those characters anyhow).

      ok i see that you mean the problem is i don`t know the data
      it should match this is part of an ocr engine that gets
      data from a tiff image....

      Thank you for your replies...
Re: regex prob
by Adrade (Pilgrim) on May 13, 2005 at 01:27 UTC
    It turns out that you can just write \w - that matches any alphanumeric character just once. It is identical to your expr above.
      -Adam

    Update: Of course, if the <br> above was intentional, that would go just after your \w.
      \w also includes _ (the underscore character). In most places it really doesn't matter, but it is a minor difference.
        Actually didn't realize that! Thanks!  Best,  -Adam