On Apr 12, 2:19 pm, ru...@yahoo.com wrote: > On Apr 11, 9:42 pm, Jean-Claude Neveu <jcn-france1...@pobox.com> > wrote: > > > My regexp that I'm matching against is: "^\$\£?\d{0,10}(\.\d{2})?$" > > > Here's how I think it should work (but clearly > > I'm wrong, because it does not actually work): > > > ^\$\£? Require zero or one instance of $ or £ at the start of the > > string. > > The "or" in "$ or £" above is a vertical bar. You > want ^(\$|£)? here.
Best not to use a capturing group (blah) when you don't need to capture ... use (?:blah) instead. When the alternatives are all single characters, for greater typing efficiency and computing efficiency use a character class: ^[\$£]? -- http://mail.python.org/mailman/listinfo/python-list