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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:07:15+00:00 2026-05-23T12:07:15+00:00

I am new in python.I have data in a 2d- array in the following

  • 0

I am new in python.I have data in a 2d- array in the following format.

array[0]                                              array[1]
Arkan                                                 Adrian Edmondson
Efgan All                                             Rik 
'Til Death Do Us Part (Star Trek: Deep Space Nine)    Bradley Thompson
'Til Death Do Us Part (Star Trek: Deep Space Nine)    David Weddle
Billy Sherrill                                       'Til I Can Make It on My Own (Deep Space) 

I want to match this string for each line in a file, if matches both array then I want to return the line.
First, I want search the both array in each line .For that my attempt was:

def strinMach(domainL, rangeR):
    text = ""
    filetext = open(File, "r").read()
        sentlist = re.split(u'[\n|\r\n]+',filetext)
    for i in sentlist:
        if domainL in i and rangeR in i:                
            text = text + i + "\n"
        elif (To search for without the parenthesis string from array[0] & array[1]
              eg.search with (Til Death Do Us Part        Bradley Thompson ) )
        elif (To search with some string from array[0] & array[1]
               es. search with(Till Death   Bradley) or (Do Us Part  Thompson))
    return text

My second step is seraching with the array except the parenthesis string (i.e except (terms)
).

And third step with the substring of both array.

How to proceed on for 2nd & 3rd step.

Any kind of help will be greatly appreciated.
Thanks!!!!!!!

  • 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-23T12:07:15+00:00Added an answer on May 23, 2026 at 12:07 pm

    I’m having a bit of trouble working out what you’re asking, but maybe this will help:

    You can remove a bracketed section of a string with:

    thetext = re.sub(r"\(.*?\)", "", thetext)
    

    (N.B. This won’t work properly if you have “((nested) brackets)”)

    You can get substrings by slicing:

    thetext[4:10]
    thetext[:5]   # First 5 characters
    thetext[-5:]  # Last 5 characters
    thetext[:-1]  # All but the last character
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am really new to Python and I have been looking for an example
I'm new to python, and have a list of longs which I want to
I have implemented a python webserver. Each http request spawns a new thread. I
Disclaimer: I'm fairly new to python! If I want all the lines of a
I am new to Python - be forewarned! I have a template class that
I'm new to Python and have what is probably a very basic question about
I am new to python, and have a question regarding store columns in lists
I have a python file like this import urllib2 try: data = urllib2.urlopen('http:....').read() except
I am new to python and struggling to find how to control the amount
I'm relatively new to Python and am having problems programming with Scapy, the Python

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.