Sorry for a stupid / easy question, but I need to figure it out. I am going to a course on datacamp, I can’t taste that description: enter image description here

I do not understand the last sentence - what exactly do characters (\) do?

  • Generally speaking, shielding in regulars R is a tricky trick, since in base R, when using the TRE engine, character classes do not “understand” regex escapes like \s . In the general case, "\\" = \ , i.e. The same literal backslash character that is used to set / form "shorthand character classes" (character classes) and escape special metacharacters for regulars. - Wiktor StribiĹĽew pm
  • difficult description for me, but thanks anyway! - Pavel Timofeev

2 answers 2

It would be more correct to say that the "\ s" with one slash is a space character, and two slashes are written so that the development environment (ide) is understood and skalala. It is called the escape character. Although in different languages ​​the shielding symbol seems different. There is also a backslash if I remember correctly "/ \ s"

  • / - this is just a slash (well, or "slash" in it-jargon). and \ - the return - aleksandr barakin
  • Thank you for your reply! - Pavel Timofeev

A metacharacter is made from the letter "s", meaning space. Called "shielding."

If you simply write "s" in a regular expression, then the letter "s" will be searched. If you write " \\s ", then spaces will be searched.

  • Thanks for the answer!!! - Pavel Timofeev