Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i get in RE2 syntax? #30

Open
sithu-go opened this issue Nov 14, 2022 · 2 comments
Open

How can i get in RE2 syntax? #30

sithu-go opened this issue Nov 14, 2022 · 2 comments

Comments

@sithu-go
Copy link

sithu-go commented Nov 14, 2022

(?: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"
      }
   }
]
@lorey
Copy link
Owner

lorey commented Nov 14, 2022

I don't understand what you're trying to achieve. Can you share the exact code you've tried?

@lorey
Copy link
Owner

lorey commented Nov 14, 2022

For the first link, you need facebook profile. According to regex101, it works. The second link needs profile by id but had a bug, try the updated regex: (?:https?:)?\/\/(?:www\.)facebook.com\/(?:profile.php\?id=)?(?P<id>[0-9]+) for the second string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants