mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
string: Also escape new lines with --style=regex
This isn't *required* in the PCRE2 spec but it greatly increases the utility of escaped regex strings at the commandline.
This commit is contained in:
@@ -309,9 +309,12 @@ string escape --style=var 中 | string unescape --style=var
|
||||
string escape --style=regex ".ext"
|
||||
string escape --style=regex "bonjour, amigo"
|
||||
string escape --style=regex "^this is a literal string"
|
||||
string escape --style=regex "hello
|
||||
world"
|
||||
# CHECK: \.ext
|
||||
# CHECK: bonjour, amigo
|
||||
# CHECK: \^this is a literal string
|
||||
# CHECK: hello\nworld
|
||||
|
||||
### Verify that we can correctly unescape the same strings
|
||||
# we tested escaping above.
|
||||
|
||||
Reference in New Issue
Block a user