What does the shortcut \ s mean in REGEX?

17

This is an intentional question, because I see many people using \s in regex thinking their meaning is ' ' (space) because I tell them, it is not, at least not only that.

  

But what does \s mean in REGEX?

    
asked by anonymous 29.01.2016 / 14:05

1 answer

12

\s covers much more than ' ' (space).

\s = [ \t\n\r\f\v]
  • ' ' (space)
  • \t TAB
  • \n new line (line break)
  • \r carriage return (returns the courses to the beginning of the line)
  • \f page forward
  • \v vertical TAB - (used in printer configurations) / li>
29.01.2016 / 14:06