On Jun 23, 6:02 pm, cirfu <[EMAIL PROTECTED]> wrote: > I need to extract prices froma html-document. > > [0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt > really matter and it is unlikely anyway to appear a $sign with no > price attahced to it I still want to prevent it. > > How do I avoid matching "$"? It has to be "nbr$".
The answer to your question is to use a + instead of *. + matches 1 or more elements, * matches zero or more. The second point to mention is that, at least where I come from, the currency symbol comes before the number: $112 and $45 In which case your regexp should be somehting like this: \$[0-9]+ Carl Banks -- http://mail.python.org/mailman/listinfo/python-list