Sorry, that second part should have been:
( url.search( /blog/ ) == -1 )
Main Topics
Browse All TopicsI am trying to make a regular expression along the lines of
/ads?\b/
Such that it would match, i.e. "www.superads.com", but I want to make sure it does _not_ match, i.e. "blogsite.com/uploads/pict
Any regex operators that Firefox 2.0 supports are fair game.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you should be aware that no regexp engine would match
superads.com
by ads\b as there is no word boundary after the ads. If you want to match it with any ads in the whole line
*ads* would do. Additionally you want to exclude uploads, so I think something like *(^uplo)ads* should be fine, or give you a direction!
>> so I think something like *(^uplo)ads* should be fine, <<
Did you mean to make that a class? You can't negate a group like you can a class and a class only matches one character, not a group. You would want to use a negative lookbehind but those aren't supported by "Firefox" (which I assume means Javascript but Arantius needs to clarify this.
Arantius, is uploads the only thing you want to ignore? Do you want to all superad or does the "s" need to be included too? Will it always be a URL and in the top domain part or would you have valid matches in the path or folders?
Please provide more examples and details of what would be valid and not valid. Also confirm what in Firefox will run this expression. These details are needed to build an expression that will work. Otherwise they are just guesses that may work but might also have problems.
Let me know if you have a question about anything I have said.
bol
In firefox:
alert('www.superads.com'.m
alerts "ads". Matches perfectly fine. A period certainly is a word boundary.
By "Firefox" yes, I mean the javascript engine running inside firefox. Meaning, I don't care about cross browser compatibility. And to clarify, I want a regular expression only, not javascript code. It happens that I am going to plug this expression into a javascript program running in firefox, but I can only put an expression here, not JS code.
Fully, I want a regular expression which:
* Does match anything that /ads?\b/ matches
* Does not match /(uplo|downlo)ads?\b/
Thanks for clarifying what will run the expression and the other details you provided. You are right that a period is a word boundary.
There is no way to do it just with an expression for Javascript. The problem is Javascript's lack of support for lookbehind. There are some alternatives but they would require script too (or at least script made for them to work). If you can modify the script then I will be happy to provide some of the alternatives. From what you said above it sounds like this isn't an option but it is the only way to get the results you want.
Let me know if you have a question or need more info.
bol
Thanks for the fun question, the grade and the points. I'm glad I could help.
If you are ever interested in some of the methods I mentioned to "fake" it there is a nice summary and explanation of three at http://blog.stevenlevithan
bol
Business Accounts
Answer for Membership
by: HonorGodPosted on 2007-12-12 at 08:01:55ID: 20457823
well:
net|gov)/ ) > -1 ) && ( usr.search( /blog/ ) == -1 ) ) {
(www\.)? can be used to match zero or 1 instance of "www."
and
(\w+\.) can be used to match the superads or any other site names
and you could further check for the presence of "blog" ..
if ( ( url.search( /(www\.)?(\w+\.)+(com|org|
...match...
}