ASSIGN_OP 中的模式匹配任何标准的赋值运算符:=、+=、-=、*=,等等,但是注意不要匹配其他包含 = 的运算符,比如 ==和 =~。
The pattern in ASSIGN_OP matches any of the standard assignment operators: =, +=, -=, *=, etc. but carefully avoids matching other operators that contain =, such as == and =~.
例如,可以使用一个模式匹配同时为两个变量赋值(参见清单31)。
For example, we can assign values to two variables simultaneously with one pattern matching (see Listing 31).
为变量赋值实际上就是一种特殊的模式匹配。
Assigning values to variables is actually a special type of pattern matching.
在赋值情况下,你可以设置稍后匹配的环境变量。
In the assignment case, you can set environment variables which you can then match against later.
udev为环境变量提供了一个ENV键, 即可用来匹配也可用来赋值.
udev provides an ENV key for environment variables which can be used for both matching and assignment.
抽取器中的变量名title和author是随意的;从捕捉组来的匹配结果会简单地从左往右被赋值,你可以叫它们任何名字。
The variable names title and author within the extractor are arbitrary; matches from capture groups are simply assigned from left to right, and you can call them whatever you'd like.
可显式指定一些字段并为发生匹配时将要赋值的其他字段提供变量。
You can specify some fields explicitly and provide variables for other fields that will be assigned when a match occurs.
可显式指定一些字段并为发生匹配时将要赋值的其他字段提供变量。
You can specify some fields explicitly and provide variables for other fields that will be assigned when a match occurs.
应用推荐