mirror of
https://github.com/rclone/rclone.git
synced 2025-10-06 05:47:10 +02:00
docs: add some more details about supported regex syntax
This commit is contained in:
committed by
Nick Craig-Wood
parent
c9df7b1cd7
commit
c3932ecde1
@@ -34,7 +34,14 @@ var commandDefinition = &cobra.Command{
|
|||||||
Long: strings.ReplaceAll(`convmv supports advanced path name transformations for converting and renaming
|
Long: strings.ReplaceAll(`convmv supports advanced path name transformations for converting and renaming
|
||||||
files and directories by applying prefixes, suffixes, and other alterations.
|
files and directories by applying prefixes, suffixes, and other alterations.
|
||||||
|
|
||||||
`+transform.Help()+`Multiple transformations can be used in sequence, applied
|
`+transform.Help()+`The regex command generally accepts Perl-style regular expressions, the exact
|
||||||
|
syntax is defined in the [Go regular expression reference](https://golang.org/pkg/regexp/syntax/).
|
||||||
|
The replacement string may contain capturing group variables, referencing
|
||||||
|
capturing groups using the syntax ¡$name¡ or ¡${name}¡, where the name can
|
||||||
|
refer to a named capturing group or it can simply be the index as a number.
|
||||||
|
To insert a literal $, use $$.
|
||||||
|
|
||||||
|
Multiple transformations can be used in sequence, applied
|
||||||
in the order they are specified on the command line.
|
in the order they are specified on the command line.
|
||||||
|
|
||||||
The ¡--name-transform¡ flag is also available in ¡sync¡, ¡copy¡, and ¡move¡.
|
The ¡--name-transform¡ flag is also available in ¡sync¡, ¡copy¡, and ¡move¡.
|
||||||
|
@@ -149,9 +149,9 @@ uses) to make things easy for users. However this does not provide
|
|||||||
absolute control over the matching, so for advanced users rclone also
|
absolute control over the matching, so for advanced users rclone also
|
||||||
provides a regular expression syntax.
|
provides a regular expression syntax.
|
||||||
|
|
||||||
The regular expressions used are as defined in the [Go regular
|
Rclone generally accepts Perl-style regular expressions, the exact syntax
|
||||||
expression reference](https://golang.org/pkg/regexp/syntax/). Regular
|
is defined in the [Go regular expression reference](https://golang.org/pkg/regexp/syntax/).
|
||||||
expressions should be enclosed in `{{` `}}`. They will match only the
|
Regular expressions should be enclosed in `{{` `}}`. They will match only the
|
||||||
last path segment if the glob doesn't start with `/` or the whole path
|
last path segment if the glob doesn't start with `/` or the whole path
|
||||||
name if it does. Note that rclone does not attempt to parse the
|
name if it does. Note that rclone does not attempt to parse the
|
||||||
supplied regular expression, meaning that using any regular expression
|
supplied regular expression, meaning that using any regular expression
|
||||||
|
Reference in New Issue
Block a user