On Dec 2, 2005, at 0:10, Bruno Bazzani wrote: >> Read up on greedy versus non-greedy matching in regular expressions. > > Thanks ! > No need to say that I'm a newbie. I'm coding with the pickaxe > manual on my side and yes ... I miss the point: sorry. > > But why did it work for the first three occurrences ? Because they're on their own line to begin with, and regular expressions (by default) work on a line-by-line basis. You will probably also want to include the multiline option in your expression, otherwise you'll fail in situations like this as well: <a href="foo.html"> un-necessary whitespace </a> matthew smillie.