<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi All,</DIV>
<DIV> </DIV>
<DIV>Following Alans suggestion, I am going to repost the question with some
test cases.</DIV>
<DIV> </DIV>
<DIV>I am looking for a way to match a string that appears in a comma separated
list. The string may may appear at the start or middle, end or nowhere on a
list. I have stumbled along and made this work in the past, now I am looking for
the clean and proper way to do it.<BR><BR>One of the unpleasant side effects of
putting a list with alternatives at the start .e.g. '(^|,)' , is that it creates
an undesired capture string. Is it possible to avoid creating the capture
string?</DIV>
<DIV> </DIV>
<DIV>Test code below. Anywhere where ‘foo’ appears should match but ‘food’
should not match</DIV>
<DIV> </DIV>
<DIV>foreach $s ('foo,bar,baz', 'bar,foo,baz', 'bar,baz,foo', 'bar,food,baz')
{<BR> print "s=$s ";</DIV>
<DIV> </DIV>
<DIV> my ($match) = $s =~ /some reg expression or perl code
here to match foo/;</DIV>
<DIV> </DIV>
<DIV> if ($match)
{<BR> print
"match=$match\n";<BR> } else
{<BR> print "no
match\n";<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Indy
Singh<BR>IndigoSTAR Software --
www.indigostar.com</DIV></DIV></DIV></BODY></HTML>