Possible Duplicate:
Regex to get value of URL parameter?
If you have a facebook link such as
What regular expression would extract the number at the end 107084586333124
edit: I use php
Possible Duplicate:
Regex to get value of URL parameter?
If you have a facebook link such as
What regular expression would extract the number at the end 107084586333124
edit: I use php
Use PHP's built-in functions to reliably pull query string variables out of a URL. You would use something like:
parse_str(parse_url($url , PHP_URL_QUERY), $v);//where $v is not set yet or an empty array
$v = @$v['v'];//will now contain the value of v or be null if not found
I'm not familiar with the PHP regex engine, but this simple regular expression should do the trick. You will find your number in the first capture group.
v=(\d+)
Replace the following regexes with ""
.
.*?\?v\=
\D*.*
The remaining data is your number.