Closed Thread Icon

Topic awaiting preservation: regular expression question Pages that link to <a href="https://ozoneasylum.com/backlink?for=27642" title="Pages that link to Topic awaiting preservation: regular expression question" rel="nofollow" >Topic awaiting preservation: regular expression question\

 
Author Thread
Aquilo
Bipolar (III) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-15-2006 06:19

it's been so long since i've used any regex my brain just can't get this right, what would be the regex code to spot this in a url?

code:
et::f14990edc0::b6bc3a9c67::676b8ec6a3



any help would be cool!
I've tryed quite a bit but still no match!

not asking for a lack of trying!

code:
^(et::\w{10}::\w{10}::\w{10})$
^(et::[a-z0-9]{10}::[a-z0-9]{10}::[a-z0-9]{10})$



thanks for any help!!!


bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-15-2006 07:51

In an url? Like inside a string?

If so you want to remove the Start String (^) and end String ($) from the sides and then both should work.



.:[ Never resist a perfect moment ]:.

Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 03:45

sweet! the little things that nevr dawn on you!

but it matches in a script but here is what I trying to do. I've made an invitation script like the one gmail uses but I dont want to have a url like

code:
http://www.domain.com/index.php?action=register;code=et::f14990edc0::b6bc3a9c67::676b8ec6a3



I want to use

code:
http://www.domain.com/et::f14990edc0::b6bc3a9c67::676b8ec6a3



and have .htaccess redirect to the script



but thanks to you I am one step closer since the regex does work!

Thanks!


Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 03:48

hey I just got the 500 error to go away!!!!!

EDIT: and have a 404... closer!




(Edited by Aquilo on 03-16-2006 03:49)

Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 04:46

sweet I got it all working!!!

here is an example!

this example will let you use any thing you want for the email it doen't even check if it's an email address so you can use foobar if you want!
http://www.elbatigers.com/index.php?module=Invitations

I with I could get the rewriterule to hide the actual url and do the redirect behind the sceen, but this is working!

code:
RewriteEngine on
RewriteRule ^(et::[a-z0-9]{10}::[a-z0-9]{10}::[a-z0-9]{10})$ http://www.elbatigers.com/index.php?module=Invitations&hash=$1 [R=301,L]




divinechaos
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

posted posted 03-16-2006 05:30

Can you use regex with mod_alias? Why not try using mod_rewrite http://httpd.apache.org/docs/2.0/misc/rewriteguide.html instead?

edit: Great, I left it the window open because I wanted to answer later, and the solution gets posted by the time I get to posting. Glad it's working.

Why are you repeating the domain in the rewrite rule? Won't this work just as well?

code:
RewriteRule ^(et::[a-z0-9]{10}::[a-z0-9]{10}::[a-z0-9]{10})$ index.php?module=Invitations&hash=$1 [R=301,L]



Might need /index.php, but one or the other should work.

Cheers,
DC

(Edited by divinechaos on 03-16-2006 05:36)

Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 05:58

when I didn't put the full url it added part of the path so it look something like
http://www.elbatigers.com/user/somethingelseidontremember/index.php?module=Invitations&hash=$1


Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 08:49

ok now it works without http://www.elbatigers.com. Thanks for all the help!!!


OpticBurn
Paranoid (IV) Inmate

From: Lower City, Iest, Lower Felda
Insane since: Sep 2000

posted posted 03-16-2006 10:23
quote:
I with I could get the rewriterule to hide the actual url and do the redirect behind the sceen, but this is working!



You can use mod rewrite to hide the url, that's probably the main application for mod rewrite. Just remove the redirect tag [R] at the end, 301 is probably the wrong tag to use anyway, since it's not a permanent redirect, save that for when you actually move content around.

Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 14:40

You know it sucks the things you forget after 2 and a half years of not doing it!
I'd hate to look at a perl script since I haven't touched them since 2001!


Aquilo
Paranoid (IV) Inmate

From: las vegas, nevada, us
Insane since: Nov 2000

posted posted 03-16-2006 14:53

EDIT: sorry double posted, the site was reallll slow so I clicked submit twice

(Edited by Aquilo on 03-16-2006 14:56)

« BackwardsOnwards »

Show Forum Drop Down Menu