/\(Start\)\@<!Date
This will match the 'Date' in 'EndDate' and 'YesterdaysDate' but will not match 'StartDate'
and what the hell, while I'm lookup up vim syntax, here's negative lookahead:
/Start\(Date\)\@!
will match the 'Start' in 'Starting but not in 'StartDate'
Positive lookahead:
/Start\(Date\)\@=
will match the 'Start' in 'StartDate' but not in 'Starting
Positive lookbehind
/\(Start\)\@<=Date
will match the 'Date' in 'StartDate' but not in 'EndDate' and 'YesterdaysDate'
Thanks. I was having trouble a while ago with trying to do lookahead/lookbehind in vim and this was helpful
ReplyDeleteThanks for this, I understand how it works now.
ReplyDeleteThis is great, I love the title of your Blog! One question, do you know if there's an easy way to use perl compatible regular expressions?
ReplyDeleteThank you for this post, it helped me understand negative lookbehind :)
ReplyDeleteExcellent post, I like that it is simple and features examples, exactly what I needed
ReplyDeleteSuccinct, awesome.
ReplyDeleteThe real necklace of a woman is not her looks but her heart. Visit my site for more interesting offer. Thank you and God bless!
ReplyDeleten8fan.net
:s/\(^\s*\)\@<!\s\+/
ReplyDeleteRemove extraneous spaces, but not at the start of the line
Don't forget "very magic" mode \so \you \don't \have \to \escape \everything:
ReplyDelete\v(Start)@<!Date
very nice publish, i certainly love this web site, carry on it online casinos
ReplyDeleteAfter research just a few of the weblog posts in your website now, and I really like your manner of blogging. I bookmarked it to my bookmark website checklist and can be checking back soon. Pls take a look at my web page as properly and let me know what you think. casino slots
ReplyDelete