Closed baskerville closed 10 years ago
AFAIK, vim isn't able to perform quite the correct match on its own, since matching the JSX pragma exactly requires multi-line matching.
I've heard that the pragma may no longer be required in future releases of the JSX transformer, though, so I'm planning on adding a global option for whether or not the pragma needs to be checked in the morning.
Please have a look at :h perl-patterns
.
It seems that .
will match new lines if \_
precedes it.
Cool, thanks for pushing on this—I tried doing the \%(\_.\%(\*\/\)\@!\)*
match before, but I think I forgot one of the backslashes before a )
. Also just wasn't aware of \_s
or \%^
... lesson learned!
On my system, grep doesn't provide any
-P
or-z
option, hence,grep -Pz '(?s)/\*(?:.(?!\*\*/))*jsx.*?\*/'
always fails (on a side note: maybe React.DOM should be matched against?).I would recommend not to use grep, vim can handle this by itself: