Actually, I missed the definition of sub MatchLAC in the OP; my reply was directed solely at Re^2: matching problem. Mea culpa.
++AnomalousMonk for the excellent exposition! I didn’t know that the empty regex acts as a stand-in for the regex most recently matched (whether the match was successful or not). Is this documented anywhere? I’ve been looking through perlre, etc., but the only mention of the empty regex I’ve found so far relates to its use with split, where it means “split the string into individual characters.”
I guess overloading it makes sense, as a match that always succeeds isn’t much use. Are there any typical use cases for employing the empty regex to mean “repeat the regex used in the previous match”?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||