Vim regex to match a tab or space?

Viewed 9439

I would like to trim the following string:

<tab>PACKAGE MAIN (the string starts with a tab space)

The goal is to get only PACKAGE MAIN as an output.

I've tried the following VIM functions with arguments

let line = substitute (line, '\t+(.*)'      , '\1', 'g')
let line = substitute (line, '\t+\(.*\)'    , '\1', 'g')
let line = substitute (line, '\t\+\(.*\)'   , '\1', 'g')
let line = substitute (line, '[\s\t]+\(.*\)', '\1', 'g')

(and much more)

What is the guideline for VIM regex to match <tab> or <space> (whitespace) chars in the substitute function?

1 Answers
Related