"\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
Steps to Reproduce:
- 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:
- Created 3 years ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
.@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.