Seems kind of excessive, but an interesting start. I have a few suggestions though.

Don't make the RegExp methods static class methods, then you can manage a server connection per-instance, which might help performance issues. Chances are if you are going to use this, you are going to use it for larger reg-exp problems and not just simple ones, so it seems to me there is a good chance you will run multiple reg-exps to the server.

Even though it could be dangerous, I would allow a full reg-ex to be sent to the server. Like this:

boolean result = myRegExpInstance.match('/(.*?)somethings/i');
Then you don't need to worry about all the possible modifiers and how to handle them in your protocol.

I would also suggest then parsing the reg-exp a little, you could could the number of () you have and then make those matches available. You should also test for any embedded perl code, and disallow it. Obviously this can get really messy, but I think it's complexity can easily be managed over time (only implement a little at a time, as the need arises maybe).

Cool idea :)

-stvn

In reply to Re: A regexp server in Perl by stvn
in thread A regexp server in Perl by pg

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.