Li Ngok Lam wrote:
>
> Hi all,
>
> That's about the whole story, but I'll make it short.
> For example, I have a list like this :
>
> 123ABCDEF456
> 123456
> 654WXYZ321
> 987654321
> ABCDEF123456
> WXYZ321
>
> By user's INTEGER input , I will have to find how many similar
> patterns are matched within the list according to certain chars (user's
> input ) :
>
> For example, I input '3', then I will get the result like this :
>
> Res1: 123ABCDEF456 is similar to 123456
> Res2: 123ABCDEF456 is similar to ABCDEF123456
> Res3: 654WXYZ321 is similar to 987654321
> Res4: 654WXYZ321 is similar to WXYZ321
>
> In case , if a pattern match happens, then the elem in list will not
> be shown again even another match happens. Okay, thaz my
> homework for how to deal with the output.
>
> The question I want to ask is how to tell ( or is this a good starting
> point ) the regex to compare the patterns freely ? So I can get
> 654WXYZ321 match 987654321 and also match WXYZ321 ?
>
> I hope I can explain my question well.

My best guess is that you want to compare an element of the array with
all other elements to find similar ones. But I'm not sure how they should
match. Explain what you mean by 'similar'. Also try reducing the list to
something like

  my @words = qw/ A1 1A AA 11 /

and explain what your output should be.

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to