Austin Biggs
Austin Biggs

Reputation: 61

Splitting a URL

I'm trying to split the following URL format: https://www.facebook.com/media/set/?set=a.10150495063500716.644503.10150093906460716&type=3

I'm trying to get the first number, between 'a.' and the next '.' I've been playing around with preg_match, but to no avail.. I'm not experienced at all with regex so perhaps I'm just using incorrect method or syntax. My attempts result in each character becoming an array key. If there's a simpler method than using regex then I'm all ears, was just pointed in this direction; all I'm needing is the number.

Any and All help is appreciated.

Upvotes: 1

Views: 51

Answers (1)

PP.
PP.

Reputation: 10864

Without knowing the exact language you're using to solve this problem the following expression may do what you want:

"a[.](\d+)[.]"

Upvotes: 1

Related Questions