[Gllug] Regexp

Jackson, Harry HJackson at colt-telecom.com
Thu Mar 7 15:48:32 UTC 2002



> -----Original Message-----
> From: Alain Williams [mailto:addw at phcomp.co.uk]
> 
> How about
> 
> $namelist = join ':', @name;
> if/^$namelist/
> 
> Or do you want to do something completely different ?

Sorry I was a bit vague. I have a list of items in an array and each one of
these items are a valid match.

@name = ("E1X","Z42","F11","34F");
@name2 = ("EX","Z242","F1wdf1","32344F");

The arrays are quite big and the letters bear no relation to each other. I
then want to check if these letters will appear in a line and output if
possible.

if /^@name\/@name2\/@name3$/

etc etc

Any single entry from each array will match. The more I look at it the more
I can see that you cannot put an array in a regular expression without some
jiggery pokery. I will do it another way

Harry


*************************************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.
*************************************************************************************


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list