These forums are closed. New forums are here.


Free Forums with no limits on posts or members.
InvisionFree - Free Forum Hosting
Welcome to FoxyProxy. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Name:   Password:

These forums are closed. New forums are here.


 

 RegEx advice needed..
wcross
Posted: May 8 2006, 03:21 PM


Newbie


Group: Members
Posts: 2
Member No.: 12
Joined: 8-May 06



I'm trying to implement a RegEx match that will include all company URL's EXCEPT from a particular host. I have the RegEx expression that I believe should work, but it's not (at least not within FoxyProxy). Maybe this is RegEx engine issue?

Anyways, the desired effect is to make all servers from domain mycompany.com EXCEPT a server called "Mine". The expression I'm using is:

https?://[0-9a-zA-Z\.]*(?<!mine)\.mycompany\.com/.*

Any regex experts out there with some advice??

Thanks!

Top
Eric H. Jung
Posted: May 8 2006, 04:16 PM


Administrator


Group: Admin
Posts: 947
Member No.: 1
Joined: 28-March 06



Hi wcross,

I don't believe Javascript (at least Mozilla/Firefox Javascript, which is implemented by SpiderMonkey) supports negative lookbehinds ((?<!mine)). You might consider posting your quesiton to Regex Advice forums. I think there are probably other ways to do what you want, perhaps by changing [0-9a-zA-Z\.]* to ([0-9a-zA-Z\.]*) and using the backreference in the regular expression. I'm no regex expert, though.

Here's HTML you can use inside Firefox to test your regular expression. Just save to a file, open in FF and test away:

CODE
<html>
<head>
<script>
 function test() {
   var regex = new RegExp("^" + document.getElementById("regex").value + "$");
   alert(regex.test(document.getElementById("uri").value)?"match":"no match");
 }
</script>
</head>
<body>
<p>Regular expression: <input type="text" id="regex" size="50"/></p>
<p>URL: <input type="text" id="uri" size="50"/></p>
<p><input type="button" value="Test" onclick="test();"/></p>
</body>
</html>


--------------------
Top
wcross
Posted: May 10 2006, 11:09 PM


Newbie


Group: Members
Posts: 2
Member No.: 12
Joined: 8-May 06



Thanks! I think I've got it. You set me in the right direction.
Top
Eric H. Jung
Posted: May 10 2006, 11:32 PM


Administrator


Group: Admin
Posts: 947
Member No.: 1
Joined: 28-March 06



Care to share? I always like to learn more about regexs...


--------------------
Top
« Next Oldest | Help and Support | Next Newest »
DealsFor.me - The best sales, coupons, and discounts for you

Topic Options



Hosted for free by InvisionFree* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0747 seconds | Archive

These forums are closed. New forums are here.