in reply to Re^2: Regex: matching character which happens exactly once
in thread Regex: matching character which happens exactly once

Yes. Like LanX, you're getting bogged down in implementation.

What do you want it to do with that syntax? How would you redefine Perl regexes to do this?

I think another symbol for backref would help. (I don't know what we'd use, but that's a different problem.) Then use the same thing for forward references. And for fun, we'll call those ferkcabs.

-QM
--
Quantum Mechanics: The dreams stuff is made of

  • Comment on Re^3: Regex: matching character which happens exactly once

Replies are listed 'Best First'.
Re^4: Regex: matching character which happens exactly once
by AnomalousMonk (Archbishop) on Oct 24, 2017 at 16:51 UTC
    How would you redefine Perl regexes to do this?

    But the  (?:[^\1]*) construct was envisioned to get around the lack of variable-width positive/negative lookbehind; I think I'd just implement that. (Of course, I suspect the reason it hasn't been implemented yet is because it's a royal pain to do so. Perhaps best to be careful what you wish for lest you find yourself with a new and very difficult assignment. As for implementing ferkcabs, I think I'd switch to another profession first. :)


    Give a man a fish:  <%-{-{-{-<