Perl match for brackets []

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

trampy

Established Member
Impact
0
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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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 =~ /\[/;
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back