Finding all numbers that are bigger than 1 in vim

2009-12-24 138 words 1 min read

If we have a csv like structure

The trick here is simple, lets look at the regex from the begining:

^ – start from the begining
() – start and end of block
[] – digits within this. So we are looking from 2 to 9 to exclude the numbers begining with 1
d – search for digits

  • – search for one or more
    | – or operation
    1 – search for numbers begining with 1
  • – containing atleast one occurence or more.<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="">Adding Leading Zeros in Excel (
  • <li class="zemanta-article-ul-li"><a href="">The Best Thing About &#8221;2010&#8221; ( <li class="zemanta-article-ul-li"><a href="">Google Goggles: The World is Your Hyperlink (
<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it