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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:00:32+00:00 2026-06-14T12:00:32+00:00

I am looking for an efficient regular expression (preferably possessive) , which i can

  • 0

I am looking for an efficient regular expression (preferably possessive), which i can use to grep lines containing only one delimiter (‘,’) from a big file (5Gb) :

E.G

X,Y
X1,Y1,Y2
X3,Y3
X4,Y4
X5,Y5,Z6

>>> grep “???” big_file

X,Y
X3,Y3
X4,Y4
  • 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-14T12:00:33+00:00Added an answer on June 14, 2026 at 12:00 pm

    Although @Rawling (one of the answers here) is right and his regular expression is correct, it is still not possessive and therefore not optimized, he is correct that no backtracking will occur, but it will not be with the best performance because the possessive quantifier doesn’t have to remember any backtracking positions. as was mentioned in the link attached in the question.

    The following expression will be possessive and optimized, i will demonstrate together with the use of grep as was asked in the question:

    grep -E “^[^,]*+,[^,]*+$” big_data

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

Sidebar

Related Questions

I have a table which contains many records. I'm looking for an efficient way
I ran Perl::Critic on one of my scripts, and got this message: Regular expression
I am looking for efficient and easy to implement code which work for media
I'm looking for an efficient manner in which to handle (methods and events of
I am looking for an efficient way to use the HttpClient for my android
I'm looking for an efficient solution to receive and process asynchronous messages (of varying
I'm looking for an efficient algorithm that for a space with known height, width
I am looking for an efficient (both computer resource wise and learning/implementation wise) method
I'm looking for an efficient algorithm for scrambling a set of letters into a
I am looking for an efficient indexed persistent data structure. I typically work in

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.