Re: escape character in regex
Hal Wigoda <[email protected]>
| Newsgroups | gmane.comp.lang.perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
Try it. (Sent from iPhone, so please accept my apologies in advance for any spelling or grammatical errors.) > On Oct 10, 2022, at 8:50 PM, Henrik Park <[email protected]> wrote: > > John, > > for my this code: > > my $delimiter = '$'; > my $str = 'hello$world$buddy'; > my @li = split/$delimiter/,$str; > print "@li","\n"; > > How can I make it work correctly? > > Thanks > > John W. Krahn wrote: >> "/" is NOT a special charater in a regular expression. It is just that in Perl the default delimiter for some operators is "/" (i.e. m//, s///, tr///, etc.). > > -- > Simple Mail > https://simplemail.co.in/ > > -- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > http://learn.perl.org/ > > -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/