Magic works :)
use re 'debug'; $_ = "one sata two N/A three N/A"; die if (/\bsata\b/i && /\bN\/A\b/ig && /\bN\/A\b/ig) ; __END__ Compiling REx `\bsata\b' size 5 Got 44 bytes for offset annotations. first at 1 1: BOUND(2) 2: EXACTF <sata>(4) 4: BOUND(5) 5: END(0) stclass `BOUND' minlen 4 Offsets: [5] 1[2] 3[4] 0[0] 7[2] 9[0] Compiling REx `\bN/A\b' size 5 Got 44 bytes for offset annotations. first at 1 1: BOUND(2) 2: EXACTF <N/A>(4) 4: BOUND(5) 5: END(0) stclass `BOUND' minlen 3 Offsets: [5] 1[2] 3[3] 0[0] 6[2] 8[0] Compiling REx `\bN/A\b' size 5 Got 44 bytes for offset annotations. first at 1 1: BOUND(2) 2: EXACTF <N/A>(4) 4: BOUND(5) 5: END(0) stclass `BOUND' minlen 3 Offsets: [5] 1[2] 3[3] 0[0] 6[2] 8[0] Matching REx `\bsata\b' against `one sata two N/A three N/A' Matching stclass `BOUND' against `one sata two N/A three ' Setting an EVAL scope, savestack=3 0 <> <one sata two> | 1: BOUND 0 <> <one sata two> | 2: EXACTF <sata> failed... Setting an EVAL scope, savestack=3 3 <one> < sata two> | 1: BOUND 3 <one> < sata two> | 2: EXACTF <sata> failed... Setting an EVAL scope, savestack=3 4 <one > <sata two> | 1: BOUND 4 <one > <sata two> | 2: EXACTF <sata> 8 < sata> < two N/> | 4: BOUND 8 < sata> < two N/> | 5: END Match successful! Matching REx `\bN/A\b' against `one sata two N/A three N/A' Matching stclass `BOUND' against `one sata two N/A three N' Setting an EVAL scope, savestack=3 0 <> <one sata two> | 1: BOUND 0 <> <one sata two> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 3 <one> < sata two> | 1: BOUND 3 <one> < sata two> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 4 <one > <sata two> | 1: BOUND 4 <one > <sata two> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 8 < sata> < two N/> | 1: BOUND 8 < sata> < two N/> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 9 <sata > <two N/A> | 1: BOUND 9 <sata > <two N/A> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 12 <a two> < N/A th> | 1: BOUND 12 <a two> < N/A th> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 13 < two > <N/A thr> | 1: BOUND 13 < two > <N/A thr> | 2: EXACTF <N/A> 16 <o N/A> < three > | 4: BOUND 16 <o N/A> < three > | 5: END Match successful! Matching REx `\bN/A\b' against ` three N/A' Matching stclass `BOUND' against ` three N' Setting an EVAL scope, savestack=3 16 <o N/A> < three > | 1: BOUND 16 <o N/A> < three > | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 17 < N/A > <three N> | 1: BOUND 17 < N/A > <three N> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 22 </A three> < N/A> | 1: BOUND 22 </A three> < N/A> | 2: EXACTF <N/A> failed... Setting an EVAL scope, savestack=3 23 </A three > <N/A> | 1: BOUND 23 </A three > <N/A> | 2: EXACTF <N/A> 26 </A three N/A> <> | 4: BOUND 26 </A three N/A> <> | 5: END Match successful! Died at same.regex.twice.pl line 5. Freeing REx: `"\\bsata\\b"' Freeing REx: `"\\bN/A\\b"' Freeing REx: `"\\bN/A\\b"'

In reply to Re^2: Looking for N/A twice by Anonymous Monk
in thread Looking for N/A twice by neo1491

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.