how can i make preg_match get the username inside of this and just ignoring the id number. (note: the id number always varies...) <a href="member.php?u=1">user</a> here's the code that im using atm but its not working :s <? preg_match_all('|<a href="member.php?u=([0-9])">(.*?)</a>|mU',$data,$result); ?> PHP: any ideas?
Pretty much the same thing. Remember if you use " to start a string container you have to escape any instances like href=\"something.html\" else it will take it litteral and end the string. But as you see below my string uses the single quote, so its not necessary to escape double quotes. 2nd with the regexp some characters are reserved like . ? so you have to also escape those with a \ if you dont want them to be taken literally. preg_match_all('#<a href="member\.php\?u=([0-9])+">(.*?)<\/a>#is',$input,$match); PHP: