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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:55:47+00:00 2026-05-28T00:55:47+00:00

I have a noisy data..something like <@ @$ FSDF >something something <more noise> Now

  • 0

I have a noisy data..something like

<@ """@$ FSDF >something something <more noise>

Now I just want to extract "something something".
Is there a way on how to delete the text between those two delimiters "<" and ">"?

  • 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-28T00:55:48+00:00Added an answer on May 28, 2026 at 12:55 am

    Use regular expressions:

    >>> import re
    >>> s = '<@ """@$ FSDF >something something <more noise>'
    >>> re.sub('<[^>]+>', '', s)
    'something something '
    

    [Update]

    If you tried a pattern like <.+>, where the dot means any character and the plus sign means one or more, you know it does not work.

    >>> re.sub(r'<.+>', s, '')
    ''
    

    Why!?! It happens because regular expressions are “greedy” by default. The expression will match anything until the end of the string, including the > – and this is not what we want. We want to match < and stop on the next >, so we use the [^x] pattern which means “any character but x” (x being >).

    The ? operator turns the match “non-greedy”, so this has the same effect:

    >>> re.sub(r'<.+?>', '', s)
    'something something '
    

    The previous is more explicit, this one is less typing; be aware that x? means zero or one occurrence of x.

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

Sidebar

Related Questions

I have data that always looks something like this: alt text http://michaelfogleman.com/static/images/chart.png I need
We have data that might look something like: A-10001 A-10002 A-10003 B-10001 B-10002 B-10003
i have data that i fetch from an email server i want to eliminate
Right now I have classes like: abstract class Record { // Required fields val
How do I filter noise of the accelerometer data in Android? I would like
I have several sources of tables with personal data, like this: SOURCE 1 ID,
There seems to be a lot of noise going on around DDD, repositories, data
Suppose you have some data that is a tone plus noise. t=0:0.01:10; y=sin(t) +
I have an unsorted list of noisy X, Y points. They do, however, form
say I have this class: class animal { function noise() { print 'woof'; }

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.