#! /usr/bin/perl use strict; use warnings; my $lookfor = "xyz123abc"; while (<DATA>) { chomp; print "$_ matched\n" if join('', /([^\.]+)/g) =~ /^$lookfor$/; } __DATA__ xyz123abc xy.z123abc xyz1.23.abc xyz123abc1
In reply to Re: Matching strings differing by a number of periods
by inman
in thread Matching strings differing by a number of periods
by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |