Dreamweaver regular expression substitution followed by number

Posted by mark on Stack Overflow See other posts from Stack Overflow or by mark
Published on 2009-11-16T17:04:41Z Indexed on 2010/06/07 2:12 UTC
Read the original article Hit count: 260

Filed under:
|

Hi. I'm using Dreamweaver to update copyright dates across my site. I want to preserve the existing spacing (or lack thereof) between years. Examples: © 2002-2008 should update to © 2002-2009 © 2003 - 2008 should update to © 2003 - 2009 This is the regular expression I'm using to accomplish this in Dreamweaver's find & replace function Find: ©\s*(\d{4}\s*-\s*)\d{3}[^9]

Replace: © $1 2009

Here's the PROBLEM: This expression works, but has that that extra space between the hyphen and 2009. If I write the replace expression without the space, as © $12009 then dreamweaver looks for the 12,009th substitution in the find expression, and, not finding one, prints $12009.

Any ideas?

© Stack Overflow or respective owner

Related posts about regex

Related posts about dreamweaver