anengineer has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Perl to Java
by Corion (Patriarch) on Jul 18, 2011 at 08:29 UTC

    Please do not post links to URL shorteners on this forum. Either post the code here, or, if the code is too long, work on your code to reduce it to a small, self-contained program that still exhibits the problem.

Re: Perl to Java
by JavaFan (Canon) on Jul 18, 2011 at 08:34 UTC
    Seems to me you have a Java problem, not a Perl one.
Re: Perl to Java
by LanX (Saint) on Jul 18, 2011 at 09:53 UTC
    IIRC there are different possible RegEx libs in Java.

    Maybe you just need to look for Perl compatibility.

    Cheers Rolf

Re: Perl to Java
by raybies (Chaplain) on Jul 18, 2011 at 12:41 UTC

    You realize that if we were to help you do this abominable thing, we'd all be committing a cardinal sin against Perl?

    That said, when I help my Java friends debug their regex problems, the most common problem they have is that they have to put their regex's in strings. So you can't just say something simple like \s, but you had to \\s all the characters that have special meaning (like \ and quotes and such). That might be your problem... dunno...

    Now I'm going to go take a shower. I feel dirty.

Re: Perl to Java
by anengineer (Initiate) on Jul 18, 2011 at 08:41 UTC
    You're right. I think, I couldn't tell you what I exactly need. When I try to compile the regular expression over there in Perl, the result is perfect. But if I compile it in Java, it doesn't work. Do you have any suggestion for me?

      You don't even tell us what problem you have with your Java code.

      This is not a code writing service, neither for Perl nor for Java. We will maybe help you with formulating the regular expression in a way that Java understands the Perl regular expression. But we don't know Java here, in general, so you will have to learn both if you want to translate from one to the other.

      The perl side is straightforward, just use perlre to decipher all the parts of the regex. First look up the flags "gxm" at the end that change some details of how the regex works.