I have a regexp like:
/^.*[?/]word[=/]/
and it seems to work as expected. Notice that neither of the weird/special characters (? or /) are escaped (I.e., preceded with \) inside of [].
Am I correct in assuming this is OK? Is there a list anywhere of what is
and isn't "special" (i.e., needing to be escaped) inside of []?
The gawk manual says:
"To include one of the characters \, ], -, or ^ in a bracket
expression, put a \ in front of it. For example:
[d\]]
matches either d or ]. Additionally, if you place ] right after
the opening [, the closing bracket is treated as one of the characters
to be matched."
Don't know if this also applies to other awk variants.
The gawk manual says:
"To include one of the characters ‘\’, ‘]’, ‘-’, or ‘^’ in a bracket
expression, put a ‘\’ in front of it. For example:
[d\]]
matches either ‘d’ or ‘]’. Additionally, if you place ‘]’ right after
the opening ‘[’, the closing bracket is treated as one of the characters to be matched."
Don't know if this also applies to other awk variants.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 793 |
Nodes: | 10 (1 / 9) |
Uptime: | 40:01:14 |
Calls: | 11,106 |
Calls today: | 3 |
Files: | 186,086 |
Messages: | 1,751,478 |