question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"\s" should match new line ("\n")

See original GitHub issue
  • Version: 1.50.0 (system setup)
  • Commit: 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
  • Date: 2020-10-07T06:10:52.432Z
  • Electron: 9.2.1
  • Chrome: 83.0.4103.122
  • Node.js: 12.14.1
  • V8: 8.3.110.13-electron.0
  • OS: Windows_NT x64 10.0.19042

螢幕擷取畫面 (1)

Steps to Reproduce:

  1. Type
123
456

in the editor. 2. Open searching window. 3. Search 123\s456.

In POSIX-Extended Regular Expressions, [:space:], which is equal to \s in vscode, representing blank (whitespace) characters including [ \t\n\r\f\v], so \s should match \n.

Does this issue occur when all extensions are disabled?: Yes

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
martynchamberlincommented, Jan 25, 2021

I’m disappointed to see how unlikely it seeming is that this blatant bug will be getting fixed. This is an embarrassing bug. Please get this fixed. It’s a direct violation of Visual Studio’s docs for \s.

4reactions
alexdimacommented, Oct 12, 2020

@IllusionMH is perfectly correct, that is how it works today.

But I agree it is surprising and a VS Code quirk. The issue came up again, so it isn’t isolated that folks expect us to behave differently. We can reopen this to track to improve this somehow… Perhaps we should detect \s and ask somehow if the regex should be considered multiline or perhaps we should just do it if the file size is small enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

match new line, why [.\n]* does not work in regex?
Using [.\n]* means a character class which will match either a dot or a newline zero or more times. Outside the character class...
Read more >
Use the \N regex character class to get “not a newline”
Perl 5.12 introduced an experimental regex character class to stand in for every character except one, the newline. The \N character class ...
Read more >
What is the regex to match a newline character?
Yes. Well, more specifically, typing a newline is the only way to match a newline character when entering a regexp interactively (as there...
Read more >
Regular expression syntax reference | AppCode Documentation
Marks the next character as either a special character or a literal. For example: n matches the character n. "\n" matches a newline...
Read more >
Python Regular Expressions | python-basics - GitHub Pages
\s – (lowercase s) matches a single whitespace character – space, newline, return, tab, form [ \n\r\t\f] . \S (upper case S) matches...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found