I want match spaces at the beginning of lines in Vim
PseudoCode of what I want to do
^( )*
I know the following fr
You're almost there. You don't need the ( ). The regex is just "^ *"
, and in Vim you search with / so you'd enter /^ *
Note that this matches on every line, because every line starts with zero or more spaces! So, do you really intend that? If you meant "one or more spaces", you need to replace *
by \+
(in most regex languages, it's +
, but the +
is escaped in vim). So, /^ \+