public interface SedOptions extends OptionSet<SedOption>
sed
command.
It is recommended to use Sed.Options
to specify a valid
combination of options.
The options for the sed command are:
-n | --quiet | Suppress the default output (in which each line, after it is examined for editing, is written to standard output). Only lines explicitly selected for output are written. | |||
-g | --global | Globally substitute for all non-overlapping instances of the regexp
rather than just the first one.
(This option is ignored if the occurrence operand is specified). | |||
-p | --print | Write the matched line to standard output. | |||
-l | --lineNumber | Writes the current line number on a separate line to the standard output. | |||
-I | --ignoreCase | Use case insensitive pattern matching. | |||
-s | --substitute | Substitutes the replacement string for instances of the regexp in
the matched line.
The characters "$0" appearing in the replacement are replaced by the line matching the regexp. The characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash. A line can be split by substituting a newline ('\n') into it. A substitution is considered to have been performed even if the replacement string is identical to the string that it replaces. | |||
-a | --append | Append string2 as a separate line after the matched line. | |||
-i | --insert | Insert string2 as a separate line before the matched line. | |||
-c | --change | Write string2 as a separate line instead of the matched line. | |||
-d | --delete | Delete the matched line. | |||
-y | --translate | Replace all occurrences of characters in string1 with the corresponding characters in string2. If the number of characters in the two strings are not equal, or if any of the characters in string1 appear more than once, the results are undefined. |
This interface serves as an alias for the extended interface to simplify the command signature methods by avoiding generic parameters.
Modifier and Type | Interface and Description |
---|---|
static class |
SedOptions.Default
Default implementation for a modifiable option set.
|
Modifier and Type | Field and Description |
---|---|
static ValueConverter<SedOptions> |
CONVERTER
Value converter for
SedOptions based on an OptionSetConverters.OptionSetConverter . |
static SedOptions |
EMPTY
Constant for an empty option set.
|
asSet, isSet, iterator, optionType, size, useAcronymFor
forEach, spliterator
static final SedOptions EMPTY
static final ValueConverter<SedOptions> CONVERTER
SedOptions
based on an OptionSetConverters.OptionSetConverter
.Copyright © 2024. All rights reserved.