True, not an error, but perhaps it is interesting to ponder why exactly the warning was issued here.
The reason that the escape
\ does not matter in this case is that a single character, other than space, is not treated as an (extended) regex string, but as a single, literal character, and so is an escape sequence like
\. (So
"\." is not a regular expression here).
So in short:
- "." a literal . character (dot).
- "\." an escape sequence that does not have a meaning here because it does not turn a . character into a special character, hence the warning. So this also gets interpreted as a single literal dot.
- "\\." a regular expression denoting a literal dot.
So in this case
split ($2, T, "\\."),
split ($2, T, "\.") and
split ($2, T, ".") have the same meaning and produce identical results, while only the second one gives a warning.
--
Not relevant in the above case, but to get a regex that consists of a special
. (denoting "any" character) one would need to use a regex constant instead:
split ($2, T, /./). On the other hand, to use a single literal dot within a regex constant
split ($2, T, /\./) would need to be used.