Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    There is only one space though, it's the character printed by printf '\x20' and that's the same thing no matter whether it is part of a string or not. Commented Dec 20, 2019 at 13:23
  • The apparent distinction between blank and space probably goes back 40 years, to paper tape. Space is an explicit ASCII code. Blank (as in 'blank tape') was a synonym for 'RunOut'. It was normal to separate lines of data with an ASCII newline, and then leave some virgin tape too (useful for splicing in to replace damage). Blank tape is also an ASCII character (no holes == no bits == 0x00 == ASCII NUL). However, most papertape readers ran in an ignore-nulls mode, so these were not read into memory. Similarly, NULs can be used in many RS232 and terminal protocols for timing reasons. Commented Dec 20, 2019 at 15:12
  • The answer and comments are true, but not particularly relevant to regular expressions. Commented Dec 21, 2019 at 17:44
  • True, but the original question was not about regexes but about the difference between blanks and spaces and whether blanks are characters. @Paul_Pedant's comment is actually the best answer to that question. Commented Jan 14, 2020 at 14:20