regexfrontpage

regex to match more than one space in FrontPage 2003


I use FrontPage 2003, and I want to use a regular expression that finds spaces (more than one space). And that ignores 1 space, and but matches only more than one space (in the text, not finding in the html code).


Solution

  • I'm not familiar with FrontPage and Notepad++ and the regex engines you may/must use in their contexts, so I'll confine myself to a few general remarks.

    To find matches (two spaces or more) in text, but not within the html tags (i.e. between < and >), you may use a regex pattern like:

    <.*?>|(?<spaces>\s{2,})
    

    If there is an issue with the {n,} specifier in your regex engine, you can replace \s{2,} by \s\s+

    Furthermore, if < and/or > are special (meta)characters in your regex engine, you'll need to espace them. (Again, I'm not familiar with the FrontPage and Notepad++ environment.)