WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

25 lines
974 B

WareLogging, VimEditor, PerlLanguage.
= perl compatible regular expressions =
[http://vim.sourceforge.net/tips/tip.php?tip_id=393 Perl compatible regular expressions]. For most of the one-off expressions you'll ever write, there's a way to do what you want in vim. That said, if you're used to Perl, translating between the two dialects becomes painful for anything much beyond a simple search and replace. Instead:
# Verify in :ver that +perl or +perl/dyn is compiled in.
# Install Perl if necessary. On Windows, ActivePerl is required.
# Type :perldo s/searchme/replaceme/g
Or:
:%!perl -pi -e 's/<text>/\n/'
On Debian, you can
apt-get install vim-perl
<[Brennen]> When using perldo to perform substitutions, keep in mind that $_ is set to the current line ''without'' a newline - so if you're expecting whitespace at the end of the line, you may not find it.
This works, though:
:perldo s/(http\S+?)(\s|$)/"$1"$2/g
Note the (\s|$).