I'm trying to distinguish between whether a given Facebook URL is a post or a video.
Luckily, Facebook lists the possible URLs for both posts and videos:
Posts:
- https://www.facebook.com/{page-name}/posts/{post-id}>
- https://www.facebook.com/{username}/posts/{post-id}>
- https://www.facebook.com/{username}/activity/{activity-id}>
https://www.facebook.com/photo.php?fbid={photo-id}>
https://www.facebook.com/photos/{photo-id}>
- https://www.facebook.com/permalink.php?story_fbid={post-id}>
- https://www.facebook.com/media/set?set={set-id}>
- https://www.facebook.com/questions/{question-id}>
- https://www.facebook.com/notes/{username}/{note-url}/{note-id}>
Videos:
- https://www.facebook.com/{page-name}/videos/{video-id}/>
- https://www.facebook.com/{username}/videos/{video-id}/>
- https://www.facebook.com/video.php?id={video-id}>
- https://www.facebook.com/video.php?v={video-id}>
However, I have no idea how to use regex to check if a given URL matches one of the above URLs.
I've started a regex101 page, but I'm not sure where to go from here: