Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Answer: How do I escape '#' pound sign?

( #59939=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How do I escape '#' pound sign? contributed by ariels

Inside a regular expression (given the section we're in):
$x = '# a comment'; print "$&\n" if $x =~ m/^\#.* # A comment! /x;
(You have to backwhack the #, or m//x will consider it a comment.

Comment on Answer: How do I escape '#' pound sign?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-03-28 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (625 votes), past polls