i am looking to parse through some urls to basicly eliminate the ones that take me off of site. I appologise for the messyness but here is the code, and ill explain a bit for everyone.
Code
@list = grep (m/(?($_=~ m;^http;)localhost.net|^\/)/;
Test Data
/sered/uplink <--test true
/my/projects/ <--test true
heh/reg <--test false
http://www.OtherNetwork.org/network/ <--test false
http://www.localhost.net/hello <--test true
Explained
ok so with this regex i want to test for the same scalar that the grep would currently be testing. Basicly saying, if it starts with an "http" it better be on this server. However if it doesnt start with that it has to start with a "/" for a sub directory.
Problem
I am unable to get this to work properly
Appologies
I am new to this advanced regex format so please be patient with me