Menu

Define Whitespaces for Search and Replace

2007-06-26
2012-11-13
  • Nobody/Anonymous

    Hi! I miss the placeholder definition possibility in the Search and Replace function. For example I have a blacklist for Spamprotection looks like this
    [...]
    *@amateur-ejacs.cc
    *@amateurxxx.com
    *@america.net
    *@amerinet.com
    *@ameritech.net
    *@amexmail.com
    *@amfax.com
    *@amracing.com
    *@ams.com
    *@andreabocellimail.com
    *@andrxlabs.com
    *@angelfire.com
    *@angenent.net
    *@anguillanet.com
    *@animus.net
    *@annopieterse.com
    *@antispam-rupar.regione.fvg.it
    [...]

    so here is used as placeholder a star '*', before '@'. This means don't accept any mails from any user from this server. So now I want to edit this list. For example I want to remove all servers that end with '.cc'. I have the following syntax *@someserver.cc and I want to search for all the servers using placeholder which I define in a textfield, for example '~', and mark a checkbox that I want to use a placeholder. Best Regards!

     
    • Nobody/Anonymous

      You should use Regular Expression!

      In Notepad version 4.1.2 type this expression:
      \*@[\w-_]+.cc

      In older version type expression:
      \*@[0-9a-zA-Z-_]+.cc

       
    • bdb4269

      bdb4269 - 2007-06-26

      Not totally sure if this is what you want, but you can currently use "wildcards" in a search if you check the "Regular Expression" box.  Using regex "." would be a wild card - but only for a single digit.  Adding a start to that --  ".*" would extend that to mean, any character/any number of charaters. 

      For more into on regular expression, check this out. It's a good guide to get you started with RegEx's.  http://www.linuxfocus.org/English/July1998/article53.html

       
    • Nobody/Anonymous

      It wouldn't work fist, then I corrected the mask to

      \*@[\w-_]+\.cc (before: \*@[\w-_]+.cc )

      When I searched, it also found expressions that just contains 'cc', *@harbourfrontcc.ca for example.

      But now have anybody a solution for that expression *@moka.ccr.jussieu.fr? It was also found, because it contains '.cc'.

      [a minute hacking]

      OK! I've done!
      Just add a '$' at the end. Here is the complete '\*@[\w-_]+\.cc$'. It could be easier! Thanks to all and special thanks goes to bdb4269 for the link to regex!!! Best regards

       
      • bdb4269

        bdb4269 - 2007-06-27

        This is a great tool for trouble shooting/learning regex's.   It will let you type in regex, and it will show you results in realtime, an a sample set of data.  So you tweak your regex to select exactly what you want without anything you don't. 

        http://weitz.de/regex-coach/

         
        • pshute

          pshute - 2007-06-28

          Re the regex learning tool, just be aware that Notepad++'s regex is almost certain to be different in quite a few areas.