Forrest logo
back to the fastmod tool

fastmod:tldr:93ee4

fastmod: Replace a regex pattern in all files of the current directory, ignoring files on .ignore and .gitignore.
$ fastmod ${regex_pattern} ${replacement}
try on your machine

The command "fastmod" is a tool used for bulk code refactoring, and it is followed by two arguments:

  1. ${regex_pattern}: This specifies a regular expression pattern that will be used to identify specific code segments within files. Regular expressions are powerful search patterns used to match and manipulate strings. For example, .* can match any sequence of characters, \d+ can match one or more digits, and (\d{3})-(\d{4}) can match phone numbers in the format XXX-XXXX.

  2. ${replacement}: This argument represents the replacement string that will be used to substitute the code segments identified by the ${regex_pattern}. It can include references to capture groups from the regular expression pattern. For example, if the regular expression pattern is (\w+)\s(\w+) (which matches two words separated by a space), the replacement string could be $2 $1, which switches the order of the words.

Combining these arguments, the "fastmod" command can be used to search for instances of code that match a specific pattern defined by ${regex_pattern} and replace them with the ${replacement} string.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the fastmod tool