vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Regular expression ".*" does not match anything

Open Rad0x6f opened this issue 10 years ago • 3 comments

  • VSCode Version: Version 0.10.11 Commit f291f4ad600767626b24a4b15816b04bee9a3049 Date 2016-03-11T17:10:35.304Z Shell 0.35.6 Renderer 45.0.2454.85 Node 4.1.1
  • OS Version: Windows 7 Enterprise SP1

Steps to Reproduce:

  1. Ctrl+F, then turn on Regex (Alt+R)
  2. Find ^.*$ ==> Bug. Does not match any lines

Note that .* doesn't match anything either. Also note that ..* (or for a full line ^..*$) matches, but only lines with at least one character Also note that ^.?.*$ does not match anything either. --> Bug

Rad0x6f avatar Mar 31 '16 19:03 Rad0x6f

+1 same here -- really surprised this isn't working. All I needed to do was add some text at beginning / end of lines.

My regex didn't work: ^.*$

pcgeek86 avatar Apr 28 '16 17:04 pcgeek86

We have some overly protective code that rejects the regexp if it matches the empty string.

alexdima avatar May 26 '16 18:05 alexdima

+1

I have a json format string below, I want to replace to empty with expression " /n(/s)*", it does not work.

{
    "a": "a",
    "b": "b"
}

by the way, it works fine in Sublime :-).

iiunknown avatar May 27 '16 04:05 iiunknown