#!/usr/bin/perl -w
use strict;
use 5.010;
my $str=<<TEXT;
{TAG}
0012310002 and 0012310003
{COUNT}
000000
{COUNT2}
000000 and 100001
TEXT
my %strh = $str=~ /({.+?}|^{}+)/sg;
my @and_contain = grep $strh{$_} =~ /and/,keys %strh;
say join(' and ',@and_contain),' is 1';
Output:
{COUNT2} and {TAG} is 1
In reply to Re: Check for 'and'
by youlose
in thread Check for 'and'
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |