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

  • SEARCH
  • Home
  • 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 6528625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:33:07+00:00 2026-05-25T09:33:07+00:00

Messing around with Groovy for a work project I ran into this oddity: def

  • 0

Messing around with Groovy for a work project I ran into this oddity:

def string = "__RNDHPD(70.2300000..70.2310000)"
def params = []
string.find(/(?<=\().*?(?=\))/).tokenize("..").each { params << it.trim() }
// should yield [70.2300000,70.2310000] but instead results in [70, 2300000, 70, 2310000]

Using an alternative token works fine though. I don’t think I am doing anything wrong, perhaps someone could shed some light on whether this my problem or something I should report to the Groovy devs.

  • 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-25T09:33:07+00:00Added an answer on May 25, 2026 at 9:33 am

    It’s not a bug, the documentation is just very poor. The tokenize method is just a wrapper around StringTokenizer, so the string you are passing to it is actually a list of delimiter characters. Try the split method instead.

    def string = "__RNDHPD(70.2300000..70.2310000)"
    def params = []
    string.find(/(?<=\().*?(?=\))/).split(/\.\./).each { params << it.trim() }
    
    assert params == ['70.2300000','70.2310000']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am messing around with node.js on Android through this project , and I
I was messing around with RhinoMocks this morning and couldn't run my tests because
I've been messing around with the free Digital Mars Compiler at work (naughty I
Im just messing around with Ruby on Rails and HTML. This question isn't about
I was messing around with Core Animation trying to get it to work, and
I was just messing around with templates, when I tried to do this: template<typename
I was messing around with JavaScript, and noticed that this can never be a
I have been messing around with HtmlUnit for a little bit and particularly this
I'm messing around with expression trees, but I'm little stuck. I have this expression:
I've been messing around with this for a few days now, hopefully someone here

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.