mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 06:03:49 +08:00
Document new PCRE2 string escaping in CHANGELOG and string.txt
This commit is contained in:
parent
e160cde606
commit
680040d17d
|
@ -67,6 +67,7 @@ A new feature flags mechanism is added for staging deprecations and breaking cha
|
||||||
- `string split` supports a new `--no-empty` option to exclude empty strings from the result (#4779).
|
- `string split` supports a new `--no-empty` option to exclude empty strings from the result (#4779).
|
||||||
- `string` has new subcommands `split0` and `join0` for working with NUL-delimited output.
|
- `string` has new subcommands `split0` and `join0` for working with NUL-delimited output.
|
||||||
- `string` no longer stops processing text after NUL characters (#4605)
|
- `string` no longer stops processing text after NUL characters (#4605)
|
||||||
|
- `string escape` has a new `--style pcre2` option for escaping strings to be matched literally in `string` regex operations.
|
||||||
- `test` now supports floating point values in numeric comparisons.
|
- `test` now supports floating point values in numeric comparisons.
|
||||||
|
|
||||||
### Interactive improvements
|
### Interactive improvements
|
||||||
|
|
|
@ -42,11 +42,13 @@ The following subcommands are available.
|
||||||
|
|
||||||
`string escape` escapes each STRING in one of three ways. The first is `--style=script`. This is the default. It alters the string such that it can be passed back to `eval` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If `-n` or `--no-quoted` is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise.
|
`string escape` escapes each STRING in one of three ways. The first is `--style=script`. This is the default. It alters the string such that it can be passed back to `eval` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If `-n` or `--no-quoted` is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise.
|
||||||
|
|
||||||
The second is `--style=var` which ensures the string can be used as a variable name by hex encoding any non-alphanumeric characters. The string is first converted to UTF-8 before being encoded.
|
`--style=var` ensures the string can be used as a variable name by hex encoding any non-alphanumeric characters. The string is first converted to UTF-8 before being encoded.
|
||||||
|
|
||||||
The third is `--style=url` which ensures the string can be used as a URL by hex encoding any character which is not legal in a URL. The string is first converted to UTF-8 before being encoded.
|
`--style=url` ensures the string can be used as a URL by hex encoding any character which is not legal in a URL. The string is first converted to UTF-8 before being encoded.
|
||||||
|
|
||||||
`string unescape` performs the inverse of the `string escape` command. If the string to be unescaped is not properly formatted it is ignored. For example, doing `string unescape --style=var (string escape --style=var $str)` will return the original string.
|
`--style=pcre2` escapes an input string for literal matching within a regex expression. The string is first converted to UTF-8 before being encoded.
|
||||||
|
|
||||||
|
`string unescape` performs the inverse of the `string escape` command. If the string to be unescaped is not properly formatted it is ignored. For example, doing `string unescape --style=var (string escape --style=var $str)` will return the original string. There is no support for unescaping pcre2.
|
||||||
|
|
||||||
\subsection string-join "join" subcommand
|
\subsection string-join "join" subcommand
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user