Multi-line regex support in Vim

Posted by Daniel on Stack Overflow See other posts from Stack Overflow or by Daniel
Published on 2009-04-24T01:13:20Z Indexed on 2010/05/25 1:31 UTC
Read the original article Hit count: 290

Filed under:
|

I notice the standard regex syntax for matching across multiple lines is to use /s, like so:

This is\nsome text
/This.*text/s

This works in Perl for instance but doesn't seem to be supported in Vim. Instead, I have to be much more specific:

/This[^\r\n]*[\r\n]*text/

I can't find any reason for why this should be, so I'm thinking I probably just missed the relevant bits in the vim help.

Can anyone confirm this behaviour one way or the other?

© Stack Overflow or respective owner

Related posts about regex

Related posts about vim