fix: make the meaning of ^ and $ more precise (#1905)
* make the meaning of ^ and $ more clear ^ and $ work differently in multi-line pattern which are different from \A and \Z. * Update regexp.md Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
parent
076c9d6b89
commit
859d8e4f0b
|
@ -36,10 +36,10 @@ description: |
|
|||
### Anchors
|
||||
|
||||
| Pattern | Description |
|
||||
| ------- | ----------------------- |
|
||||
| ------- | ---------------------- |
|
||||
| `\G` | Start of match |
|
||||
| `^` | Start of string |
|
||||
| `$` | End of string |
|
||||
| `^` | Start of string \* |
|
||||
| `$` | End of string \* |
|
||||
| `\A` | Start of string |
|
||||
| `\Z` | End of string |
|
||||
| `\z` | Absolute end of string |
|
||||
|
@ -48,6 +48,8 @@ description: |
|
|||
| `^abc` | Start with `abc` |
|
||||
| `abc$` | End with `abc` |
|
||||
|
||||
For multiline patterns (`m` flag), `^` and `$` will act as start and end of line.
|
||||
|
||||
### Escaped characters
|
||||
|
||||
| Pattern | Description |
|
||||
|
|
Loading…
Reference in New Issue