Lines Matching +refs:po +refs:active +refs:comment +refs:regexp
106 @c unwise to comment it out when running a master in case there are
386 * Constants:: String, numeric and regexp constants.
390 * Using Constant Regexps:: When and how to use a regexp constant.
769 @c I saw a comment somewhere that the preface should describe the book itself,
1907 A @dfn{comment} is some text that is included in a program for the sake
1913 In the @command{awk} language, a comment starts with the sharp sign
1925 You can put comment lines into keyboard-composed throwaway @command{awk}
1927 comment is to help you or another person understand the program
1937 an apostrophe (i.e., a single quote) into a comment (or anywhere else
2595 starts a comment, it ignores @emph{everything} on the rest of the
2607 In this case, it looks like the backslash would continue the comment onto the
2609 noticed because it is ``hidden'' inside the comment. Thus, the
2691 @cindex regexp, See regular expressions
2692 @c STARTOFRANGE regexp
2695 A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a
2706 both. Such a regexp matches any string that contains that sequence.
2707 Thus, the regexp @samp{foo} matches any string containing @samp{foo}.
2774 @var{exp} ~ /@var{regexp}/
2779 matches @var{regexp}. The following example matches, or selects,
2799 does @emph{not} match @var{regexp}:
2802 @var{exp} !~ /@var{regexp}/
2818 @cindex regexp constants
2819 @cindex regular expressions, constants, See regexp constants
2820 When a regexp is enclosed in slashes, such as @code{/foo/}, we call it
2821 a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
2831 (@code{"foo"}) or regexp constants (@code{/foo/}).
2846 string or regexp. Thus, the string whose contents are the two characters
2851 unprintable characters directly in a string constant or regexp constant,
2857 sequences apply to both string constants and regexp constants:
2924 A literal slash (necessary for regexp constants only).
2925 This expression is used when you want to write a regexp
2926 constant that contains a slash. Because the regexp is delimited by
2928 in order to tell @command{awk} to keep processing the rest of the regexp.
2944 In a regexp, a backslash before any character that is not in the previous list
2948 normally be a regexp operator. For example, @code{/a\+b/} matches the three
2962 for both string constants and regexp constants. This happens very early,
2966 @command{gawk} processes both regexp constants and dynamic regexps
3014 escape to represent a regexp metacharacter.
3016 Does @command{awk} treat the character as a literal character or as a regexp
3026 escape sequences literally when used in regexp constants. Thus,
3043 are valid inside a regexp. They are introduced by a @samp{\} and
3156 @cindex @code{*} (asterisk), @code{*} operator, as regexp operator
3157 @cindex asterisk (@code{*}), @code{*} operator, as regexp operator
3200 If there is one number in the braces, the preceding regexp is repeated
3202 If there are two numbers separated by a comma, the preceding regexp is
3204 If there is one number followed by a comma, then the preceding regexp
3224 However, because old programs may use @samp{@{} and @samp{@}} in regexp
3230 For new programs that use @samp{@{} and @samp{@}} in regexp constants,
3232 regexp constants are valid and work the way you want them to, using
3234 using a string constant with a regexp operator or function.}
3237 @cindex precedence, regexp operators
3248 stand for themselves when there is nothing in the regexp that precedes them.
3314 A character class is only valid in a regexp @emph{inside} the
3408 then @code{[[.ch.]]} is a regexp that matches this collating element, whereas
3409 @code{[ch]} is a regexp that matches either @samp{c} or @samp{h}.
3417 ``e,'' ``@`e,'' and ``@'e.'' In this case, @code{[[=e=]]} is a regexp
3443 @cindex word, regexp definition of
3445 additional regexp operators. These operators are described in this
3509 @command{gawk}'s regexp library routines consider the entire
3564 GNU regexp operators.
3567 GNU regexp operators described
3582 treated literally, even if they represent regexp metacharacters.
3636 When @code{IGNORECASE} is not zero, @emph{all} regexp and string
3671 affected regexp operations only. It did not affect string comparison
3673 Beginning with @value{PVERSION} 3.0, both regexp and string comparison
3704 to make a change to the input record. Here, the regexp @code{/a+/}
3726 Understanding this principle is also important for regexp-based record
3744 regexp constant (i.e., a string of characters between slashes). It may
3747 regexp. A regexp that is computed in this way is called a @dfn{dynamic
3748 regexp}:
3756 This sets @code{digits_regexp} to a regexp that describes one or more digits,
3757 and tests whether the input record matches this regexp.
3762 operators, there is a difference between a regexp constant
3771 @cindex regexp constants, slashes vs. quotes
3772 @cindex @code{\} (backslash), regexp constants
3773 @cindex backslash (@code{\}), regexp constants
3774 @cindex @code{"} (double quote), regexp constants
3775 @cindex double quote (@code{"}), regexp constants
3781 For example, @code{/\*/} is a regexp constant for a literal @samp{*}.
3787 @cindex troubleshooting, regexp constants vs. string constants
3788 @cindex regexp constants, vs. string constants
3789 @cindex string constants, vs. regexp constants
3790 Given that you can use both regexp and string constants to describe
3791 regular expressions, which should you use? The answer is ``regexp
3797 more difficult to read. Using regexp constants makes your programs
3802 It is more efficient to use regexp constants. @command{awk} can note
3803 that you have supplied a regexp and store it internally in a form that
3809 Using regexp constants is better form; it shows clearly that you
3810 intend a regexp match.
3819 character to be used inside a character list for a dynamic regexp:
3830 @cindex newlines, in regexp constants
3831 But a newline in a regexp constant works with no problem:
3844 @c ENDOFRANGE regexp
3851 locale setting can affect the way regexp matching works, often
4139 of @code{RS} as a regexp and @code{RT}.
4516 to add a comment, as we've shown here.
4877 to @code{FS} (the backslash is stripped). This creates a regexp meaning
4894 The character can even be a regexp metacharacter; it does not need
4897 @item FS == @var{regexp}
4898 Fields are separated by occurrences of characters that match @var{regexp}.
4899 Leading and trailing matches of @var{regexp} delimit empty fields.
4957 affects field splitting @emph{only} when the value of @code{FS} is a regexp.
4970 alphabetic character while ignoring case, use a regexp that will
5151 string @code{"\n\n+"} to @code{RS}. This regexp matches the newline
5177 or a regexp, this special feature of @code{RS} does not apply.
5190 regexp for that single character. For example, if the field
5275 @item RS == @var{regexp}
5276 Records are separated by occurrences of characters that match @var{regexp}.
5277 Leading and trailing matches of @var{regexp} delimit empty records.
5375 comment ends and another begins on the same line.)
5401 For example, suppose the next line is a comment or a special string,
7118 Without the call to @code{close} indicated in the comment, @command{awk}
7258 * Constants:: String, numeric and regexp constants.
7259 * Using Constant Regexps:: When and how to use a regexp constant.
7441 @cindex regexp constants
7446 A regexp constant is a regular expression description enclosed in
7450 (which are just ordinary strings or variables that contain a regexp).
7456 @cindex dark corner, regexp constants
7458 operators, a regexp constant merely stands for the regexp that is to be
7460 However, regexp constants (such as @code{/foo/}) may be used like simple expressions.
7462 regexp constant appears by itself, it has the same meaning as if it appeared
7494 @cindex @command{gawk}, regexp constants and
7495 @cindex regexp constants, in @command{gawk}
7497 This code is ``obviously'' testing @code{$1} for a match against the regexp
7500 against the regexp @code{/foo/}. The result is either zero or one,
7518 @cindex differences in @command{awk} and @command{gawk}, regexp constants
7519 @cindex dark corner, regexp constants, as arguments to user-defined functions
7528 the third argument of @code{split} to be a regexp constant, but some
7531 This can lead to confusion when attempting to use regexp constants
7556 In this example, the programmer wants to pass a regexp constant to the
7561 @command{gawk} issues a warning when it sees a regexp constant used as
8293 @cindex advanced features, regexp constants
8294 @cindex dark corner, regexp constants, @code{/=} operator and
8295 @cindex @code{/} (forward slash), @code{/=} operator, vs. @code{/=@dots{}/} regexp constant
8296 @cindex forward slash (@code{/}), @code{/=} operator, vs. @code{/=@dots{}/} regexp constant
8297 @cindex regexp constants, @code{/=@dots{}/}, @code{/=} operator and
8303 @cindex ambiguity, syntactic: @code{/=} operator vs. @code{/=@dots{}/} regexp constant
8304 @cindex syntactic ambiguity: @code{/=} operator vs. @code{/=@dots{}/} regexp constant
8305 @cindex @code{/=} operator vs. @code{/=@dots{}/} regexp constant
8307 operator and regexp constants whose first character is an @samp{=}.
8684 True if the string @var{x} matches the regexp denoted by @var{y}.
8687 True if the string @var{x} does not match the regexp denoted by @var{y}.
8755 @cindex comparison expressions, string vs. regexp
8756 @c @cindex string comparison vs. regexp comparison
8757 @c @cindex regexp comparison vs. string comparison
8789 either a regexp constant (@code{/@dots{}/}) or an ordinary
8791 dynamic regexp (@pxref{Regexp Usage}; also
8794 @cindex @command{awk}, regexp constants and
8795 @cindex regexp constants
8797 expression in slashes by itself is also an expression. The regexp
8798 @code{/@var{regexp}/} is an abbreviation for the following comparison expression:
8801 $0 ~ /@var{regexp}/
9354 This kind of pattern is simply a regexp constant in the pattern part of
9356 The pattern matches when the input record matches the regexp.
9385 slashes (@code{/@var{regexp}/}), or any expression whose string value
9414 @cindex regexp constants, as patterns
9415 @cindex patterns, regexp constants as
9416 A regexp constant as a pattern is also a special case of an expression
10691 is to simply say @samp{FS = FS}, perhaps with an explanatory comment.
10700 and all regular expression matching are case independent. Thus, regexp
10704 @code{FS}, all ignore case when doing their particular regexp operations.
10714 and regexp operations are always case-sensitive.
10777 If it is a regexp, records are separated by
10778 matches of the regexp in the input text.
12448 @item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]})
12452 @var{regexp}. It returns the character position, or @dfn{index},
12456 The @var{regexp} argument may be either a regexp constant
12458 In the latter case, the string is treated as a regexp to be matched.
12467 @samp{@var{string} ~ @var{regexp}}.
12523 matched by @var{regexp}. If @var{regexp} contains parentheses,
12570 a regexp describing where to split @var{string} (much as @code{FS} can
12571 be a regexp describing where to split input records). If
12610 the third argument to be a regexp constant (@code{/abc/}) as well as a
12615 discussion of the difference between using a string constant or a regexp constant,
12668 @item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]})
12672 leftmost, longest substring matched by the regular expression @var{regexp}.
12677 The @var{regexp} argument may be either a regexp constant
12679 In the latter case, the string is treated as a regexp to be matched.
12708 stands for the precise substring that was matched by @var{regexp}. (If
12709 the regexp can match more than one string, then this precise substring
12732 illustrates the ``leftmost, longest'' rule in regexp matching
12768 Finally, if the @var{regexp} is not a regexp constant, it is converted into a
12769 string, and then the value of that string is treated as the regexp to match.
12771 @item gsub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]})
12792 @item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) #
12796 the regular expression @var{regexp}. Unlike @code{sub} and @code{gsub},
12800 @var{regexp} with @var{replacement}. Otherwise, @var{how} is treated
12801 as a number that indicates which match of @var{regexp} to replace. If
12806 regexp in the replacement text. This is done by using parentheses in
12807 the regexp to mark the components and then specifying @samp{\@var{N}}
12828 which match of the regexp should be changed:
12847 If @var{regexp} does not match @var{target}, @code{gensub}'s return value
14655 collected into a portable object file (@file{guide.po}),
14661 @cindex @code{.po} files
14662 @cindex files, @code{.po}
14666 For each language with a translator, @file{guide.po}
14674 Each language's @file{.po} file is converted into a binary
14956 @cindex @code{.po} files
14957 @cindex files, @code{.po}
14961 be extracted to create the initial @file{.po} file.
14965 @command{gawk}'s @option{--gen-po} command-line option extracts
14982 @cindex @code{--gen-po} option
14988 @cindex @code{--gen-po} option
14992 First, use the @option{--gen-po} command-line option to create
14993 the initial @file{.po} file:
14996 $ gawk --gen-po -f guide.awk > guide.po
15000 When run with @option{--gen-po}, @command{gawk} does not execute your
15208 Run @samp{gawk --gen-po} to create the @file{.po} file:
15211 $ gawk --gen-po -f guide.awk > guide.po
15218 @c file eg/data/guide.po
15235 appear in the @file{guide.po} file.
15244 $ cp guide.po guide-mellow.po
15245 @var{Add translations to} guide-mellow.po @dots{}
15253 @c file eg/data/guide-mellow.po
15277 @cindex @code{.po} files, converting to @code{.mo}
15278 @cindex files, @code{.po}, converting to @code{.mo}
15279 @cindex @code{.mo} files, converting from @code{.po}
15280 @cindex files, @code{.mo}, converting from @code{.po}
15287 @file{.po} file to machine-readable @file{.mo} file.
15293 $ msgfmt guide-mellow.po
15890 in a comment,
16011 includes a trace of any active functions:
16274 @item -W gen-po
16275 @itemx --gen-po
16276 @cindex @code{--gen-po} option
16902 Also, verify that all regexp and string constants used in
19330 The program begins with a comment describing the options, the library
19658 Use @var{pattern} as the regexp to match. The purpose of the @option{-e}
19667 The program begins with a descriptive comment and then a @code{BEGIN} rule
20368 the options and their meanings in a comment.
21538 Comments start with either @samp{@@c} or @samp{@@comment}.
21558 @samp{@@comment} by letting the @samp{omment} part be optional.
21770 Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp
21829 The program relies on @command{gawk}'s ability to have @code{RS} be a regexp,
22570 The use of regexp constants, such as @code{/foo/}, as expressions, where
22832 as regexp operations
22859 The ability for @code{RS} to be a regexp
22939 for capturing text-matching subexpressions within a regexp
22988 The @option{--gen-po} command-line option and the use of a leading
23463 @itemx po/*
23465 @command{gawk}'s internationalization features, while the @file{po} library
24238 and comment out or delete the two lines @samp{#define __STDC__ 0} and
24781 The ability for @code{RS} to be a regexp
25716 @c comment made multiline for page breaking
26568 The regexp metacharacters @samp{^} and @samp{$}, which force the match
26838 separated by whitespace (or by a separator regexp that you can
26954 some part of the regexp. Interval expressions were not traditionally available
27021 regexp describes the contents of the string, it is said to @dfn{match} it.
27024 Characters used within a regexp that do not stand for themselves.
27098 Short for @dfn{regular expression}. A regexp is a pattern that denotes a
27099 set of strings, possibly an infinite set. For example, the regexp
27106 See ``regexp.''