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 8099039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:16:19+00:00 2026-06-05T22:16:19+00:00

I am trying to manipulate a string to a format of regexp String months1

  • 0

I am trying to manipulate a string to a format of regexp

String months1 = "(?<month>(?i:January|February|March|April|May|June|July|August|September|October|November|December))";
String monthsResult = months1.replaceAll("([^\\(\\?\\<month\\>\\(\\?i])([a-zA-Z])", "$0 ?");

I would like to have the result in format that after (?<month>(?i: would every character have a whitespace, but the code above shows:

(?<month>(?i:J ?an ?ua ?ry ?|F ?eb ?ru ?ar ?y|M ?ar ?ch ?|A ?pr ?il|M ?ay ?|J ?un ?e|J ?ul ?y|A ?ug ?us ?t|S ?ep ?tem ?be ?r|O ?ct ?obe ?r|N ?ove ?mbe ?r|D ?ec ?em ?be ?r))

Is there something to do with the grouping or my replaceAll function regexp is not exact?

Any help would be appreciated.

The expected result would be

"(?<month>(?i:J ?a ?n ?u ?a ?r ?y|F ?e ?b ?r ?u ?a ?r ?y|M ?a ?r ?c ?h|A ?p ?r ?i ?l|M ?a ?y|J ?u ?n ?e|J ?u ?l ?y|A ?u ?g ?u ?s ?t|S ?e ?p ?t ?e ?m ?b ?e ?r|O ?c ?t ?o ?b ?e ?r|N ?o ?v ?e ?m ?b ?e ?r|D ?e ?c ?e ?m ?b ?e ?r))
  • 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-06-05T22:16:20+00:00Added an answer on June 5, 2026 at 10:16 pm

    You could use an expression like:

    (?<=\(\?<month>\(\?i:.{0,16000})\w\B
    

    Replaced with $0 ?.

    str.replaceAll("(?<=\\(\\?<month>\\(\\?i:.{0,16000})\\w\\B", "$0 ?");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to manipulate a conditional string outputted from SAS into the right
I have a simple string that I'm trying to manipulate: Your order will be
I am trying to manipulate a string using Jython, I have included below an
I'm trying to manipulate a string.. For example: string DiagnosesString 250.00 03 350.0001 450.00
I'm trying to manipulate the output of Wordpress' the_date() function. My code: <?php define('WP_USE_THEMES',
I am trying to manipulate SharePoint's default calendar to add, edit and delete items
question 1: i am trying to manipulate same classed div element's css to their
I'm having trouble trying to manipulate music using buttons I can't seem to make
I have a global variable averagel that I am trying to manipulate in a
I'm trying to use QueryPath to manipulate HTML in PHP. It works fine until

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.