diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-12-30 15:30:19 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-12-30 15:30:19 -0800 |
| commit | a07da1989d7ec515d4bb08051ea6940960577446 (patch) | |
| tree | 6f506818554fc205ddcc46a3c9bfe6054ae9cea7 /README.md | |
| parent | 7d4bc36949cec8e5c791c352a264cd1dea4f8a1e (diff) | |
Simplified syntax for replacement: just =>, no need for {}
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -60,9 +60,8 @@ Pattern | Meaning `>pat` | `pat` matches just in front of the current position (lookahead) `@pat` | Capture `pat` (used for text replacement and backreferences) `@foo=pat` | Let `foo` be the text of `pat` (used for text replacement and backreferences) -`{pat => "replacement"}` | Match `pat` and replace it with `replacement` -`{pat @other => "@1"}` | Match `pat` followed by `other` and replace it with the text of `other` -`{pat @keep=other => "@keep"}` | Match `pat` followed by `other` and replace it with the text of `other` +`pat => "replacement"` | Match `pat` and replace it with `replacement` +`(pat1 @keep=pat2) => "@keep"` | Match `pat1` followed by `pat2` and replace it with the text of `pat2` `pat1==pat2` | `pat1`, assuming `pat2` also matches with the same length `pat1!=pat2` | `pat1`, unless `pat2` also matches with the same length `#( block comment )#` | A block comment |
