Dynadot โ€” .com Registration $8.99

Perl match for brackets []

Spaceship Spaceship
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
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back