0

Regex - :\s|,\s|,|\s|/|\\|\&|\$|"|%
Also tried [:\s,\s,\s/\\\&\$"%] with the same results.

I have marked replacement characters for a visual view to make sure.

enter image description here

Andrew Morton
  • 2,957
  • 2
  • 20
  • 29
user68650
  • 3
  • 1
  • 1
    What exactly are you trying to do with this regex? Please add examples of text from before and how it should look after. – harrymc Apr 27 '19 at 17:01
  • Regex above replaces illegal characters that cannot be used in a filename. The list of characters above are being replace with and underscore. – user68650 Apr 28 '19 at 02:03

1 Answers1

1

Because you are replacing \s with nothing. \s stands for any kind of white space, including linebreaks.

If you want to replace only horizontal spaces (i.e. space, tab) use \h.

Toto
  • 17,001
  • 56
  • 30
  • 41
  • All these years, I never knew \s would replace \r\n in Notepadd ++ or that a \h could be used for a space - make no sense for Regex but it works! thank you! Much appreciated. – user68650 Apr 28 '19 at 02:01
  • found some info here. https://notepad-plus-plus.org/community/topic/15279/unicode-blank-characters-and-the-regexes-h-v-and-s Thank you again Toto – user68650 Apr 28 '19 at 02:10