Code Monkey home page Code Monkey logo

social-media-profiles-regexs's Issues

Youtube regex

https?://[w.]{4}?(youtube.com/user/[A-z_0-9-.]{2,100})

How can i get in RE2 syntax?

(?:https?:)?//(?:www.)?(?:facebook|fb).com/(?P(?![A-z]+.php)(?!marketplace|gaming|watch|me|messages|help|search|groups)[A-z0-9_-.]+)/?

my string looks like this

[
   {
      "node":{
         "id":"100084753152635",
         "url":"https:\/\/www.facebook.com\/profile.php?id=100084753152635",
         "name":"Hannah"
      }
   },
   {
      "node":{
         "id":"100049247496610",
         "__isProfile":"User",
         "url":"https:\/\/www.facebook.com\/sayar.tole.31",
         "name":"\u1010\u102d\u102f\u1038 \u101d\u1031 \u101c\u1004\u103a\u1038"
      }
   }
]

Support Recruiter profiles for LinkedIn

LinkedIn Recruiter urls do not have an in or pub on the path but recruiter.

Example : http(s)?:\/\/([\w]+\.)?linkedin\.com\/(in|pub|recruiter)\/[A-z0-9_-]+\/?

Regexes that filter username part from the regex

I noticed that the regexes used do not provide username back as part of the regex. An example on how to do this is:

(?:(?:http|https)://)?(?:www.|m.)?facebook.com/(?!home.php)(?:(?:\w)#!/)?(?:pages/)?(?:[?\w-]/)?(?:profile.php?id=(?=\d.*))?([\w.-]+)$

This allows you to filter out all the things you do not need and only return username as a result.
Wouldn't it be a good idea to take this as the standard for this repo?

Example for instagram that only returns username:
https://regex101.com/r/DBVLCq/1

(Might also be a good idea to always include a regex101.com address so people can add tests and improve regexes

[QUESTION] Use or not use https as default

Most social networks use https or redirect entries on port 80 to 443 ... unknown that does not use https ๐Ÿ˜จ

In cases (obvious) where the service uses https but the user informs http ... the link may even be correct because it points to a valid endpoint once the application server redirects it, however in my opinion (not based on a normalization) the regex should fail (deny)

The GitHub for example (the regex) in my view is incorrect because the site itself does not transmit data if not by https and the www subdomain is not used

// how are you now
http(s)?:\/\/(www\.)?github\.com/[A-z 0-9 _ -]+\/?

// perhaps a more correct approach
https:\/\/github\.com/[a-zA-Z0-9_-]+\/?

RegEx ASCII Special Characters

As I was testing some patterns, I noticed that you used 'A-z' for alphanumeric characters. When you do that, it will match any character between 65-122 ASCII, that includes lowercase, uppercase, and a few special characters, including underscores. To fix that and only include characters a-z(97-122) and A-Z(65-90), you need to change 'A-z' to 'a-zA-Z'

Remove "www" and "s" from capture group?

I've been developing a library for server-side & client-side link identification & validation. I've been using the non-capturing groups (?:s)? and (?:www\.)?. The regex parser will use it to match the text, but ignores it later when returning the results and can make it easier to identify the account/user/media ID.

Example: ^http(?:s)?:\/\/(?:www\.)?facebook\.com\/([a-zA-Z0-9_]+)$

More social media profiles

I see that there hasn't been any additions within the last 2 years. Here are the ones that you've identified that match some of the initial regex filters I've written. (NOTE: These also work extremely well when using the jQuery validation and adding the regex below to the data-rule-pattern attributes.)

Instagram
^http(?:s)?:\/\/(?:www\.)?instagram\.com\/([a-zA-Z0-9_]+)$

Google Plus
^http(?:s)?:\/\/plus\.google\.com\/(.+)$

Pinterest
^http(?:s)?:\/\/(?:www\.)?pinterest\.com\/([a-zA-Z0-9_]+)$

Vimeo Video
^http(?:s)?:\/\/(?:www\.)?vimeo\.com\/(?:channels\/[0-9]+\/)?([0-9]+)$ ^http(?:s)?:\/\/(?:www\.)?vine\.co\/v\/([a-zA-Z0-9_\/]+)$

VimeoChannel
^http(?:s)?:\/\/(?:www\.)?vimeo\.com\/channels\/([0-9]+)$

Skype
^skype:([a-zA-Z0-9_]+)\?call$

WordPress
^http(?:s)?:\/\/(?:[a-zA-Z0-9-]+)?.wordpress\.com\/(?!feed)(.+)?$

YouTube Channel
^http(?:s)?:\/\/(?:www\.)?youtube\.com\/channel\/(?:\w+\/)?([a-zA-Z0-9_-]+)$

YouTube Embed
^http(?:s)?:\/\/(?:www\.)?youtube.com\/embed\/([a-zA-Z0-9_-]+)$

YouTube User
^http(?:s)?:\/\/(?:www\.)?youtube\.com\/user\/(?:\w+\/)?([a-zA-Z0-9_-]+)$

YouTube Video
^http(?:s)?:\/\/(?:www\.)?youtube\.com\/(?!user)(?!channel)(?:\w+\/)?([a-zA-Z0-9_-]+)(?:\/)?$

YouTube Video
^http(?:s)?:\/\/youtu.be/([a-zA-Z0-9_-]+)$

StackOverflow
^http(?:s)?:\/\/(?:www\.)?stackoverflow\.com\/(.+)$

Why are tho two forward slashes not optional in URLs?

For example https://www.facebook.com and //www.facebook.com would work, whereas www.facebook.com wouldn't work.

Is this an error?

It would be beneficial to have regex's not require the https:// for the off chance they're not specified in some document being scraped

Fix linkedin recruiter and add /talent url regex

There is a bug in the linkedin recruiter URL regex, it lacks the "profile" part

This is how the link should be
https://www.linkedin.com/recruiter/profile/476162262,HHNH,name

Also, the URL regex for the "talent" endpoint is missing
https://www.linkedin.com/talent/profile/AEEAABxhqNYBJa6QzJWImzsC_q6ugSZg2H6s7pA

Please let me know if you'd like a pull request or you'll fix them by yourself :)

Edit: /sales is also missing.
I'll create a regex and a PR later :)

Add test case for #23

Let's add a test case for #23 to ensure people see examples of accented slugs in the wild ๐Ÿ˜

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.