Solved

Phyton Regular Expression help, pls

Posted on 2008-10-09
1
233 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
1 Comment
 
LVL 1

Accepted Solution

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The really strange introduction Once upon a time there were individuals who intentionally put the grass seeds to the soil with anticipation of solving their nutrition problems. Or they maybe only played with seeds and noticed what happened... Som…
This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

730 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