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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:18:02+00:00 2026-06-14T22:18:02+00:00

I have a very large String. It can be seen here: http://pastebin.com/vqXJ3WV6 I want

  • 0

I have a very large String. It can be seen here:
http://pastebin.com/vqXJ3WV6

I want to split this string using the regex 3.8
When I search this string using notepad, I find two instances of 3.8.
Therefore, I would expect the array which is returned to have a length of 3.

System.err.println(convertPdfToText(save).split("3.8").length);

However, calling this with convertPdfToText fetching this String has a length of 4?

enter image description here

I do not understand this at all in the slightest. Can anybody tell me what is going on because this is changing the behaviour of my program massively.

Thanks in advance

  • 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-14T22:18:03+00:00Added an answer on June 14, 2026 at 10:18 pm

    The . character is a special character in regex which literally means “any character”. So you’re basically looking for 3[anything]8, and a quick regex search shows that there is indeed 3 matches for that. Two are the valid “3.8” strings you were actually looking for. Your unintended match is located at the end of this string:

    3.4 Unit 3: Spanish speaking 46953 8

    The solution is simply to use the . literal instead by escaping the character with backslashes:

    System.err.println(convertPdfToText(save).split("3\\.8").length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large set of string URL patterns like {http://www.imdb.com, http://www.amazon.com ,...}
I have a very large string (HTML) and in this HTML there is particular
I have a very large .json file on disk. I want to instantiate this
I have a very large UIView approx 3000x3000 in size. In this large view
I have very large string lists and arrays and i found 2 issues that
I have a very large string in the form: a1 + b1 a2 +
I am hoping someone can help me (once again). I have a very large
I have an object defined as : std::unordered_map<std::string, std::vector<int>> large_obj; It can store very
I have a very large string that needs to escape all the single quotes
I have a very large 60+ question form that the user can start to

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.