Hi Monks,

I have a doubt on how to do a regex match only with alphanumeric. I am putting a scenario here pls help.

$data_main = "The ideal Rack cleaning support candidate is dedicated t +o providing outstanding customer service every day. New Store Opening Promenade in Crocker Park Rack Nordstrom Rack is a division of Nordstrom, a fashion specialty retaile +r founded on a simple idea: offer customers the best possible service +, quality, value and selection. We are looking for motivated people t +o provide cleaning services to maintain a pleasant shopping environme +nt for our customers. Nordstrom Rack is where customers go for top-of-the-line Nordstrom fas +hion and accessories at fabulous values. When you work for Nordstrom +Rack, you'll enjoy flexible hours, a friendly atmosphere and competit +ive pay and benefits. You'll also be a part of a team that is committ +ed to supporting your career goals. We are always looking for exceptional people who share our love for th +e customers we serve, the merchandise we sell and the work we do!"; $out = $1 if ($data_main =~ /(NewStoreOpeningPromenadeinCrockerParkRac +kNordstromRackisadivisionofNordstrom.*)/is); print $out; exit; Desired Output -------------- New Store Opening Promenade in Crocker Park Rack Nordstrom Rack is a division of Nordstrom, a fashion specialty retaile +r founded on a simple idea: offer customers the best possible service +, quality, value and selection. We are looking for motivated people t +o provide cleaning services to maintain a pleasant shopping environme +nt for our customers. Nordstrom Rack is where customers go for top-of-the-line Nordstrom fas +hion and accessories at fabulous values. When you work for Nordstrom +Rack, you'll enjoy flexible hours, a friendly atmosphere and competit +ive pay and benefits. You'll also be a part of a team that is committ +ed to supporting your career goals. We are always looking for exceptional people who share our love for th +e customers we serve, the merchandise we sell and the work we do!

Basically, I only want to include the alphanumeric only to do the matching process, NO SPACES, NO NEW LINES etc.. How can I achieve it?

Thanks for your time.


In reply to Perl Regex Match (Compare Only AlphaNumeric) by Anonymous Monk

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.