I am not sure about that.
It is perfectly allowed to use a
character classPerl short-cut within brackets
I get the same results, but I wonder where that is documented ...
(Some doc searching and a short meeting later ...)
It's hidden in perlrecharclass:
You can put any backslash sequence character class (with the exception of \N and \R) inside a bracketed character class, and it will act just as if you had put all characters matched by the backslash sequence inside the character class. For instance, [a-f\d] matches any decimal digit, or any of the lowercase letters between 'a' and 'f' inclusive.
[...]
Examples:
/[\p{Thai}\d]/ # Matches a character that is either a Thai # character, or a digit. /[^\p{Arabic}()]/ # Matches a character that is neither an Arabic # character, nor a parenthesis.
So I stand corrected.
[\d] means the same as [0-9] [\w] would mean same as [a-zA-Z0-9_]
Well, that's only true if you ignore Unicode. perlre points to perlunicode, which has this nice short explaination:
- \p{Word}
- This is the same as \w, including over 100_000 characters beyond ASCII.
Alexander
In reply to Re^4: In my it is printing in the else i want to get output for the for loop in linux.
by afoken
in thread In my it is printing in the else i want to get output for the for loop in linux.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |