Page 1 of 1

RegExp in JavaScript

Posted: Thu Jan 22, 2004 7:02 am
by mzfp2
Hi all

right, I really hate regular expressions, so I need help constructing the following

I need to extract my url from a string, which could either be 'http://alljammin.com/' or 'http://www.alljammin.com/' or just 'www.alljammin.com/'

leaving me with the reamainder of the string

so for instance

'http://www.alljammin.com/shizzle'

should leave me with 'shizzle'

Thanks for all ya help!

http://www.alljammin.com !

Posted: Thu Jan 22, 2004 7:05 am
by malcolmboston
without meaning too sound nasty

you have been asking pretty much the same question to do the same thing for ages now

go here for your answer

hope that helps

Posted: Thu Jan 22, 2004 8:01 am
by mzfp2
well yeah its do with the same thing, but its a totally different question, i aint asked bout reg expressions before! and its wot this forum is here for .. i'm only asking for help, and i appreciate the people who help me out!

and thanks for your help too bubba!

Posted: Thu Jan 22, 2004 8:09 am
by malcolmboston
*cough*look!*cough*

edit: the answer to the problem you are trying to overcome is in that page

Posted: Thu Jan 22, 2004 8:14 am
by mzfp2
that's all to do with trapping the request for a page that doesnt exist, i've managed to do that now, soo all i need to do is use a reg exp, but reg expressions really scare me man, which is why I asked !!

Posted: Thu Jan 22, 2004 8:22 am
by malcolmboston
couldnt you do something like

click here

took me 5 seconds scouring php.net :?

Posted: Thu Jan 22, 2004 8:37 am
by mzfp2
I'm not using PHP, its a html page

Posted: Thu Jan 22, 2004 8:43 am
by malcolmboston
ah, im sorry for the confusion i searched arund and found some things that may be of use to you

here
here
very helpful
here

hope these help

Posted: Thu Jan 22, 2004 8:52 am
by mzfp2
thanks man, you're a star, I will send u a huge check when im rich !

it cud happen!

Posted: Thu Jan 22, 2004 8:53 am
by malcolmboston
lol good luck

just remember, search engines are a programmers best friend :lol: