Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 50b1d7239aad89000200002d

Extract text from xml

Extract text from xml file (ignoring commented out elements) and create a one line regex.

Start file
<list>
  <item>txt123</item>
  <!-- <item>txt124</item> -->
  <!-- <item>txt126</item> -->
  <item>txt127</item>
  <item>txt137</item>
  <!-- <item>txt145</item> -->
  <item>txt148</item>
  <!-- <item>txt150</item> -->
</list>
End file
^(txt123|txt127|txt137|txt148).*$

View Diff

1,10c1
< <list>
<   <item>txt123</item>
<   <!-- <item>txt124</item> -->
<   <!-- <item>txt126</item> -->
<   <item>txt127</item>
<   <item>txt137</item>
<   <!-- <item>txt145</item> -->
<   <item>txt148</item>
<   <!-- <item>txt150</item> -->
< </list>
---
> ^(txt123|txt127|txt137|txt148).*$

Solutions by @twistedcommons:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @mhbvim

41 active golfers, 101 entries

Solutions by @twistedcommons:
28
#2 - Armin / @twistedcommons

02/11/2013 at 04:00AM

35
#>16 - Armin / @twistedcommons

02/11/2013 at 03:58AM

37
#>19 - Armin / @twistedcommons

02/11/2013 at 03:54AM

44
#>28 - Armin / @twistedcommons

02/11/2013 at 03:52AM

47
#>33 - Armin / @twistedcommons

02/11/2013 at 03:40AM

59
#>36 - Armin / @twistedcommons

02/11/2013 at 03:35AM

79
#>39 - Armin / @twistedcommons

02/11/2013 at 03:28AM

127
#>40 - Armin / @twistedcommons

02/11/2013 at 03:33AM