Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Perlish extended regexs
- " Barry Arthur, Sep 2011
- function! R(s)
- return substitute(substitute(a:s, '".\{-}\s\+_', '', 'g'), '\s\+', '', 'g')
- endfunction
- function! TestThis(str)
- let my_extended_regex = '
- \ ^ " start of line _
- \ \s* " skip whitespace _
- \ \w\+ " first word _
- \'
- return matchstr(a:str, R(my_extended_regex))
- endfunction
- echo TestThis("hello, world")
Advertisement
Add Comment
Please, Sign In to add comment