Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: regex and substrings

by jeffenstein (Friar)
on Jul 23, 2018 at 15:57 UTC ( #1219115=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if( index($str1, $str2) > -1 && $str1 ne $str2 ){
        print "$str2 is a substring of $str1\n";
    }
    
  2. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        my ($substring, $string) = @_;
        return 1 if index($string, $substring) > -1 && $string ne $substri
    +ng;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1219115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2021-03-05 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (109 votes). Check out past polls.

    Notices?