Thanks for the further info. I ended up going with a similar case to your second suggestion (m/\G(\\\$\w+|\$\w+)/gc, though I didn't repeat the \w+ since there was other stuff in the regex after that) and it seems to be working fine.

The s/// solution seems like it'd be quite expensive, requiring many, many memcopy's. As I'm using this tokenizer fairly heavily, I don't think that's really a good idea. Though, of course, maybe Perl's smarter than I'm giving it credit for. ;-)

Hopefully pretty soon I'll be able to post the code I'm working on here for some peer review, as well as a link to a "showcase" page. It's getting pretty close to finished and I really think it's pretty cool. I'm looking forward to getting everyone's opinion on my code and the ideas behind it. I've really appreciated your help here, MeowChow, and I hope that you'll give it a look when I finally get it all posted. =)

For now, I think I should really go to bed. It's 6am here and I have to get up in 6.5 hours to get ready for work (so that I can go in and work on this project some more! :-). Have a good night/day/whatever, everyone and thanks again!

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.


In reply to (bbfu)(MeowChow's workarounds)Re: Re: (RE bug)Re: Re: RE prollem: \G, \\? and disappearing data by bbfu
in thread RE prollem: \G, \\? and disappearing data by bbfu

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.