vimscript: Function stridx return value is an index (#988)
* Bugfix: function return value is an index * White-space change * Bugfix and clarification
This commit is contained in:
parent
42950dfac7
commit
aff27988e0
|
@ -152,7 +152,7 @@ Functions
|
||||||
substitute(str, '.', 'x', 'g')
|
substitute(str, '.', 'x', 'g')
|
||||||
strpart("abcdef", 3, 2) " == "de" (substring)
|
strpart("abcdef", 3, 2) " == "de" (substring)
|
||||||
strpart("abcdef", 3) " == "def"
|
strpart("abcdef", 3) " == "def"
|
||||||
stridx("abcdef", "e") " == "e"
|
stridx("abcdef", "e") " == 4
|
||||||
strridx() " reverse
|
strridx() " reverse
|
||||||
|
|
||||||
matchstr('testing','test') " == 'test' (or '')
|
matchstr('testing','test') " == 'test' (or '')
|
||||||
|
|
|
@ -316,10 +316,13 @@ Checks if it's the same instance object.
|
||||||
### Regexp matches
|
### Regexp matches
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
"hello" =~ '/x/'
|
"hello" =~ 'xx*'
|
||||||
"hello" !~ '/x/'
|
"hello" !~ 'xx*'
|
||||||
|
"hello" =~ '\v<\d+>'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`\v` enables "extended" regex mode which allows word boundary (`<>`), `+`, and more.
|
||||||
|
|
||||||
### Single line
|
### Single line
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
|
|
Loading…
Reference in New Issue