In comp.lang.javascript message
<11**********************@14g2000cws.googlegroups. com>, Sat, 25 Nov 2006
19:08:32, shellon <zh*********@gmail.comwrote:
>Thanks a lot! I'm sorry that I didn't describe my problem exactly, The
pattern I want to match is actually is :
I want to match all the pages of the site www.raphsy.com but the home
page www.raphsy.com/welcome.html
so one Regexp maybe: str.match(/^www\.raphsy\.com\//) &&
!str.match(/welcome\.html$/)
That rejects, contrary to specification,
www.raphsy.com/banana/welcome.html
>but I don't want to use two bool expression, I want to combine the two
expression in one RegExp, that's to say: how to negate a pattern(like
/welcome\.html/) in RegExp?
And does it have to be compatible with all browsers that understand
RegExps? If so, consider
OK = !!str.replace(/welcome.html/, "\u20A4")
.match(/^www\.raphsy\.com\/[^\u20A4]/)
Few modern pages will have \u20A4 anywhere, let alone in the URL.
It's a good idea to read the newsgroup and its old FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
<URL:http://www.jibbering.com/faq/ Old RC FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.