- 论坛徽章:
- 1
|
回复 6# jason680
Thanks
I have found it about "\Q \E"
AFS:
\Q is the string interpolation alias for quotemeta. It escapes all non-word characters after it in an double quoted string AFTER the interpolation step. Therefore ensuring that the value of $line is treated as a literal string.
\E indicates that \Q should stop. Technically it's not needed in your regex since it's at the end anyway. But for consistency I always include it, since it's a way of explicitly documenting that you truly mean to escape just the value of $line.
You can read more about interpolation of double quoted strings here:
perldoc perlop - Quote and Quote-like Operators
perldoc perlop - Gory details of parsing quoted constructs.
”www。tek-tips。com/viewthread.cfm?qid=1426346“
|
|