Skip to content

Commit f7c332d

Browse files
authored
Merge pull request #13168 from mattmartini/branch-for-challenge-316
Solutions for challenge 316
2 parents b95ba17 + 207f77e commit f7c332d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

challenge-316/matt-martini/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Matt Martini
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
6+
# my $str1 = "uvw";
7+
# my $str2 = "bcudvew";
8+
9+
# my $str1 = "aec";
10+
# my $str2 = "abcde";
11+
12+
my $str1 = "sip";
13+
my $str2 = "javascript";
14+
15+
my $str1_prere = join( '.*', unpack( "(a)*", $str1 ) );
16+
my $str1_re = qr<$str1_prere>;
17+
18+
if ( $str2 =~ $str1_re ) {
19+
print "true\n";
20+
}
21+
else {
22+
print "false\n";
23+
}

0 commit comments

Comments
 (0)