adambard / adambard/learnxinyminutes-docs

The Vimscript use a wrong regex sample

Open
#5,200 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Markdown
Stars
12.3k
Forks
3.7k
Avg merge
13h 10m
Merged PRs (30d)
6

Description

In the line 112-118.
The sample put the pattern and string in wrong place, so the match test always false, the unmatch test always true.
I think the follow is better:
```
echo "hello" =~ "He" | " Regular expression match, uses 'ignorecase'
echo "hello" =~# "He" | " Regular expression match, case sensitive
echo "hello" =~? "He" | " Regular expression match, case insensitive
echo "hello" !~ "He" | " Regular expression unmatch, use 'ignorecase'
echo "hello" !~# "He" | " Regular expression unmatch, case sensitive
echo "hello" !~? "He" | " Regular expression unmatch, case insensitive
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.