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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:26:14+00:00 2026-05-15T13:26:14+00:00

I am trying to use regular expressions to determine what format the user have

  • 0

I am trying to use regular expressions to determine what format the user have applied when entering input in a textbox.
The regular expressions are as follows:

(\\s?[" + alphabet + "]{9,9})+

To determine whether the input is one or more strings of length 9 in a given alphabet, possibly separated by whitespace.

(>[\\w\\s]+\\n[" + alphabet + "\\s]+)+

To check if the input is in FASTA format

The regular expressions run terribly slow when matching with inputString.matches(regexString). Why is this?

I figured this may be due to Java storing all potential matches (which I don’t need at this point), but adding ?: in every parenthesis breaks the regex. How should this be done?

Thank you,

Martin

Edit 1: I was unable to reproduce this issue – it only happens on one computer. This could suggest something wrong with that particular VM setup.
We need something more robust, and so we will be implementing this differently. I have picked Joel’s answer as the right one, since I believe that some special case in Pattern may be the cause.

  • 1 1 Answer
  • 1 View
  • 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-15T13:26:15+00:00Added an answer on May 15, 2026 at 1:26 pm

    If you have a number of different regular expression patterns that are being matched against the same input to try to categorize the input, then you are likely to be better off using a lexical analyzer generator like JFlex.

    Other Java-based lexical analyzer and parsing tools that are typically used in compiler construction can be found listed here.

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

Sidebar

Related Questions

I am trying to determine whether a string input by a user is valid
I have never been any good at regular expressions. I am trying to use
I am trying to use regular expressions to find a UK postcode within a
I am trying use javascript regular expressions to do some matching and I found
I'm trying to use regular expressions in R to find one or more phrases
I am trying to use regular expressions to make my inventory upload script a
I have been trying to create a regular expressions pattern that matches any reference
I'm trying to parse some AS3 with the use of Regular Expressions. I cannot,
I'm trying to use regular expressions to match a string that does not contain
I'm currently trying to use regular expressions in C#: Regex reg_gameinfo = new Regex(@PokerStars

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.