in reply to Re: Looking for N/A twice
in thread Looking for N/A twice

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"'