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

  • Home
  • SEARCH
  • 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 3280250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:41:00+00:00 2026-05-17T19:41:00+00:00

First, I don’t know if this is actually possible but what I want to

  • 0

First, I don’t know if this is actually possible but what I want to do is repeat a regex pattern.
The pattern I’m using is:

sed 's/[^-\t]*\t[^-\t]*\t\([^-\t]*\).*/\1/' films.txt

An input of

250.    7.9    Shutter Island (2010)    110,675

Will return:

Shutter Island (2010)

I’m matching all none tabs, (250.) then tab, then all none tabs (7.9) then tab. Next I backrefrence the film title then matching all remaining chars (110,675).

It works fine, but im learning regex and this looks ugly, the regex [^-\t]*\t is repeated just after itself, is there anyway to repeat this like you can a character like a{2,2}?

I’ve tried ([^-\t]*\t){2,2} (and variations) but I’m guessing that is trying to match [^-\t]*\t\t?

Also if there is any way to make my above code shorter and cleaner any help would be greatly appreciated.

  • 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-05-17T19:41:01+00:00Added an answer on May 17, 2026 at 7:41 pm

    I think you might be going about this the wrong way. If you’re simply wanting to extract the name of the film, and it’s release year, then you could try this regex:

    (?:\t)[\w ()]+(?:\t)
    

    As seen in place here:

    http://regexr.com?2sd3a

    Note that it matches a tab character at the beginning and end of the actual desired string, but doesn’t include them in the matching group.

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

Sidebar

Related Questions

First of all I don't know if this is the right approach. I want
First, I don't know where to ask this question. Well this is programming QA
First: apologies for the question title, I don't actually know what the problem is
i newbie this my first project,I don't know how to resolve any problems about
First of all i don't know whether the title is relevant or not (please
I don't understand why the first program in JSP is working, but the second
First, I don't want to use a database or a local file. Is it
First of all, I don't want to use a join because that will make
I don't understand why atoi() is working for every entry but the first one.
First of all, I apologize for the English, I don't know how to write

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.