Hello rohan_532,

I am sorry but I am not able to understand what you mean.

I will try guess your way of thinking and you can verify or falsify or correct me if this is what you are looking for.

Based on your answer Example:- The description variable value is the one to compare in array., let's create a scenario with sample data something that YOU should have done so we will be able to replicate the problem.

#!usr/bin/perl use strict; use warnings; # Variables that I will extract from the escel sheet my @steps_name = ("1-2 Steps", "5-7 Steps", "8-10 Steps", "11-15 Steps +"); #regex that I want to match against foreach (@steps_name) { print "Matched with ".$_."\n" if /(?:\b8-10 Steps\b|\b11-15 St +eps\b)/; } __END__ $ perl test.pl Matched with 8-10 Steps Matched with 11-15 Steps

You can combine regular expression if, if this is what you are looking for. Provide us a sample of expected input and desired matched output. It does not have to be compiling code, produce a pseudo code.

Update: Apologies if I sounded a bit harsh but we need to know what exactly you are looking for, so we can help you as soon as possible. If your question is still not answered please provide us more information.

Hope this helps.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^5: compare individual string with complete array by thanos1983
in thread compare individual string with complete array by rohan_532

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.