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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:55:57+00:00 2026-06-07T19:55:57+00:00

I have one problem when i am using following code snippet String regexString=regexPair.get(paramName); Pattern

  • 0

I have one problem when i am using following code snippet

 String regexString=regexPair.get(paramName);

 Pattern p = Pattern.compile(regexString);
 Matcher m = p.matcher(paramMap.get(paramName)[0]);
 status = m.matches();

it return false

where regexPair is hashmap and regexPair.get(paramName) is

"^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"

while I will ureplace

String regexString="^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"

then it works fine

paramMap.get(paramName)[0] return agsd@gmail.com.

I am not getting why this is occurring please help me.

  • 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-07T19:55:59+00:00Added an answer on June 7, 2026 at 7:55 pm

    How do you know that regexPair.get(paramName) is the string you’ve given? Is that the result of some println call?

    I suspect the quoting is not entirely the same. It may be that regexPair.get(paramName) actually contains '\\' followed by another '\\' (that is, two real backslashes in succession), while the replacement only contains "\\" (which is a single backslash). Note that the string "(\\." is really only 3 characters long.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have summarized my problem in following code snippet. In the first code
I have the following problem: Using asp.net C# and calling several places in code
i have one problem when i sort the NSMutablearray using date and time wise.
here is the problem. I have one PC using VS2008 (SP1 ) and another
I have a problem; I'm using an external library where one particular event has
My problem is this one, I am using Sharepoint 2010, I have a form
I have one problem , I want to get some data from XML file
I'm using following code to add rounded corners to my UIImage, but the problem
Using the Entity Framework Code First paradigm I have defined the following objects and
I'm having a problem with the following code. I want to use one UIImageView

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.