So I need a regular expression for finding single line and multi line comments, but not in a string. (eg. `"my /* string"`)

for testing (`#` single line, `/*` & `*/` multi line):

```
# complete line should be found
lorem ipsum # from this to line end
/*
  all three lines should be found
*/ but not here anymore
var x = "this # should not be found"
var y = "this /* shouldn't */ match either"
var z = "but" & /* this must match */ "_"

```

SO does the syntax display really well; I basically want all the gray text.  

I don't care if its a single regex or two separates. ;)

EDIT: one more thing. the opposite would also satisfy me, searching for a string which is not in a comment  

this is my current string matching: `"[\s\S]*?(?<!\\)"` (indeed: will not work with `"\\"`)

EDIT2:  

OK finally I wrote my own comment parser -.-  

And if someone else is interested in the source code, grab it from here: <https://github.com/relikd/CommentParser>