I believe I understand what you're asking here and if my answer doesn't help I apologize.

These are a couple of very simplistic methods you might be able to use, or might be able to spark your imagination with. Again, I'm only about 50% confident I understand what your asking...

1. You will probably not want to do something like this because of a number of reasons. First '|' regexes are prety expencive, combined with not having any anchors, a possibly infinate size array in @tags(), it could be quite an intensive process. However, if the array is to remain very static and somewhat small it might be a viable solution:
my @tags = qw( 1= 2= 3= .. ); my $reg_ex = join( '|', @tags ); open FILE, 'dat.log' || die "$!\n"; while ( <FH> ) { print "$_\n" if ( $_ =~ /$reg_ex/s ); }

I had more examples, but I am quickly realizing I don't fully understand the problem enought to continue. Some questions that come up are:

1. Does the array @tags() have the potential of growing very large?
2. Is the contents of the file going to be consistant. For instance, will lines always start with 'tag=...' or will it be invariable?
3. Is there any more general detail you might be able to expose?

My answer, again, might help out (and hope it does). Other than that, I'm not sure what else to say...

---hA||ta----
print map{$_.' '}grep{/\w+/}@{[reverse(qw{Perl Code})]} or die while ( 'trying' );

In reply to Re: Message regex by wazzuteke
in thread Message regex by minixman

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.