How to remove 2 characters from the beginning of a string after using filename-modifiers? So assume that I have a files that looks like this:
/home/drskoolie/projects/examples/ex40.c
/home/drskoolie/projects/examples/ex1.c
What I want is to get the number 40 and 1 out of the file names respectively using filename-modifiers (this is later going to a function that will send it to another tmux window). Writing this command gets me almost there: :!echo '%:p:t:r'
ex40
ex1
How do I now remove the first two characters here to get:
40
1
trim('ex')
ormatchstr('\d\+')
to get the number. If you want it to work in the shell context with:!
you'll have to use something like| grep -o '\d+'
.