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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:12:30+00:00 2026-05-26T06:12:30+00:00

I am a novice in regex and trying to understand it by solving small

  • 0

I am a novice in regex and trying to understand it by solving small problems. So here I am with a problem which I couldn’t solve (warning: it may be extremely silly). Your inputs will help me understand the concept.

I want to write a regex which will match all items in list1 but none of those from list2

list1

   pit
   spot
   spate
   slap two
   respite

list2

   pt
   Pot
   peat
   part

I was thinking like “give me all the items that starts with p|s|r and endswith it|ot|e|o
So i wrote ^[p|s|r].*[it|ot|e|o]$ which eventually resulted in undesired result.

Thanks in advance for your inputs.

  • 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-26T06:12:31+00:00Added an answer on May 26, 2026 at 6:12 am

    In notepad you can’t do or operations (taken from Notepad++: A guide to using regular expressions and extended search mode and tested on my Notepad++ 5.9.3)

    This would work in other “standard” regexes 🙂

    ^[psr].*(it|ot|e|o)$
    

    Try here. http://gskinner.com/RegExr/?2uudn

    What were you doing was using the [] instead of the grouping (). It was equivalent to: [itoe|] (were the | was a “standard” character instead of or) and in general everything in an [] is in or 🙂 [ab] means a or b.

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

Sidebar

Related Questions

SQL novice here. I'm trying to get a list of invoice numbers. There are
A novice at WPF / XAML, I've been wrestling with layout and trying to
Python novice here. I am using python2.7.2 on Windows7. I have installed the PyWin32
I am a JS novice so go easy on me here. But I wrote
I'm a novice MySQL user so could really use a little advice here. I've
I'm a novice at regex, so hopefully some expert can just yawn at my
I'm trying to remove, via regular expression, all but alphanumeric characters & spaces. Here's
I am trying to build an application which does the following : 1) write
So, I've URL encoded a word doc trying to parse certain fields..which is a
I have a regex which I'm using to match user functions inside an IDE

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.