Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3795876
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:09:01+00:00 2026-05-19T13:09:01+00:00

I am trying to convert an RPN-equation into a string that matches tigcc rules.

  • 0

I am trying to convert an RPN-equation into a string that matches tigcc rules. There numbers must have the number of chars in front of them and a tag for positive or negative. For “2” it would be “1 2 POSINT_TAG”

My complete input to rpn converter is based on regexes, so I wanted to use them again and have a String.replaceAll() function like:

string.replaceAll("(\d+)","$1".length+" $1 POSINT_TAG");

But there it just prints: “2 number INT_TAG”. I found some classes like com.stevesoft.pat (link).

Is there another way implemented in normal Sun Java to use (custom) functions in replace rules of regexes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:09:01+00:00Added an answer on May 19, 2026 at 1:09 pm

    No, at least not the same way you would do it in C# or Ruby.

    The closest thing is to write a loop like this:

    static Pattern pattern = Pattern.compile("\\d+");
    String convert(String input) {
        StringBuffer output = new StringBuffer();
        Matcher matcher = pattern.matcher(input);
        while (matcher.find()) {
            String rep =
                String.format("%d %s POSINT_TAG",
                              matcher.group().length(),
                              matcher.group());
            matcher.appendReplacement(output, rep);
        }
        matcher.appendTail(output);
        return output.toString();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to convert an int into three bytes representing that int (big
I have an XML file and I'm trying convert it into a (table( HTML
Trying to convert a JSON string into an object in C#. Using a really
Im trying to convert this php function to javascript: function sanitize_words($string,$limit=false) { preg_match_all(/\p{L}[\p{L}\p{Mn}\p{Pd}'\x{2019}]{1,}/u,$string,$matches,PREG_PATTERN_ORDER); return
Im trying to convert a string such as 12 August 2011 into time_t or
Trying to convert this c code into MIPS and run it in SPIM. int
I'm trying to convert some code that worked great in VB, but I can't
I am trying to convert an ASP.NET website into a web application project. The
I'm trying to convert an incoming sting of 1s and 0s from stdin into
Trying to convert super(B, self).method() into a simple nice bubble() call. Did it ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.