NamePros.Com (http://www.namepros.com/)
-   Programming (http://www.namepros.com/programming/)
-   -   Perl match for brackets [] (http://www.namepros.com/programming/463015-perl-match-for-brackets.html)

trampy 04-28-2008 10:15 AM

Perl match for brackets []
 
Is there a way to search for a [ in Perl using character codes or other methds? I have tried a \[ escape but that does not work. for example

$string = =~ s/[//;

Will not work because perl sees the [ and thinks it is an unclosed statement.

bryan1884 05-03-2008 10:13 PM

you need to place your backslash before the special character. Are you saying you have tried this? If not i believe this is what it should look like.

$string =~ /\[/;


All times are GMT -7. The time now is 08:39 PM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0