?
Solved

Phyton Regular Expression help, pls

Posted on 2008-10-09
1
Medium Priority
?
242 Views
Last Modified: 2010-04-16
Need help writing a regular expression:

I need a regexp to match a URL, so I need to include all URLs that have a 'hello' in them and exclude all URLs that have 'bye' in them, in other words,
need a regexp that matches .*hello.* but does not match .*bye.*

NOTE: I replaced the super-secret  words with 'hello' and 'bye' ;)
I promise this is not a homework, I just suck with Regular Expressions and could not find online the exclude pattern
Thanks!
0
Comment
Question by:Gula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Gula earned 0 total points
ID: 22681681
.*hello(?!.*bye.*)
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction On September 29, 2012, the Python 3.3.0 was released; nothing extremely unexpected,  yet another, better version of Python. But, if you work in Microsoft Windows, you should notice that the Python Launcher for Windows was introduced wi…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question