Search code examples
sublimetext3

Remove Unorder Number From Sublime


i Have Data Like this

9372127603
9372130412
9372140
9372175041
937218
9372190908
9372191764

i need output like

9372127603
9372130412
9372175041
9372190908
9372191764

what i do to achieve this in sublime text ?


Solution

  • You can do this via regex Find and Replace. Open Find → Replace…, make sure the regex option is on, enter ^\d{1,9}\n into the Find: field, and make sure the Replace: field is empty:

    Full window before replace

    Explanation:

    ^       beginning of line
    \d      any digit
    {1,9}   match preceding between 1 and 9 times, inclusive
    \n      newline character
    

    test at Regex101

    Once you've done that, hit Replace All and any numbers less than 10 digits long will be removed:

    after replace