GithubHelp home page GithubHelp logo

regextokens's Introduction

Base64

Format

^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$

Twitter

Access Token

[1-9][0-9]+-[0-9a-zA-Z]{40}

Username

/(^|[^@\w])@(\w{1,15})\b/

Tweets

View source

Facebook

Access Token

EAACEdEose0cBA[0-9A-Za-z]+

OAuth 2.0

[A-Za-z0-9]{125} (counting letters [2])

Instagram

OAuth 2.0

[0-9a-fA-F]{7}.[0-9a-fA-F]{32}

Username

(?:@)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:.(?!.))){0,28}(?:[A-Za-z0-9_]))?)

Hashtag

(?:#)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:.(?!.))){0,28}(?:[A-Za-z0-9_]))?)

Google

API Key

AIza[0-9A-Za-z-_]{35}

OAuth 2.0 Secret Key

[0-9a-zA-Z-_]{24}

OAuth 2.0 Auth Code

4/[0-9A-Za-z-_]+

OAuth 2.0 Refresh Token

1/[0-9A-Za-z-]{43}|1/[0-9A-Za-z-]{64}

OAuth 2.0 Access Token

ya29.[0-9A-Za-z-_]+

GitHub

Personal Access Token (Classic)

^ghp_[a-zA-Z0-9]{36}$

Personal Access Token (Fine-Grained)

^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$

OAuth 2.0 Access Token

^gho_[a-zA-Z0-9]{36}$

User-to-Server Access Token

^ghu_[a-zA-Z0-9]{36}$

Server-to-Server Access Token

^ghs_[a-zA-Z0-9]{36}$

Refresh Token

^ghr_[a-zA-Z0-9]{36}$

Foursquare

Client Key

[0-9a-zA-Z_][5,31]

Secret Key

R_[0-9a-f]{32}

Picatic

API Key

sk_live_[0-9a-z]{32}

Stripe

Standard API Key

sk_live_[0-9a-zA-Z]{24}

Restricted API Key

rk_live_[0-9a-zA-Z]{99}

Square

Access Token

sqOatp-[0-9A-Za-z-_]{22}

OAuth Secret

q0csp-[ 0-9A-Za-z-_]{43}

PayPal / Braintree

Access Token

access_token,production$[0-9a-z]{161[0-9a,]{32}

Amazon Marketing Services

Auth Token

amzn.mws.[0-9a-f]{8}-[0-9a-f]{4}-10-9a-f1{4}-[0-9a,]{4}-[0-9a-f]{12}

Twilio

Access Token

55[0-9a-fA-F]{32}

Mailgun

Access Token

key-[0-9a-zA-Z]{32}

MailChimp

Access Token

[0-9a-f]{32}-us[0-9]{1,2}

Slack

OAuth v2 Bot Access Token

xoxb-[0-9]{11}-[0-9]{11}-[0-9a-zA-Z]{24}

OAuth v2 User Access Token

xoxp-[0-9]{11}-[0-9]{11}-[0-9a-zA-Z]{24}

OAuth v2 Configuration Token

xoxe.xoxp-1-[0-9a-zA-Z]{166}

OAuth v2 Refresh Token

xoxe-1-[0-9a-zA-Z]{147}

Webhook

T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}

Amazon Web Services

Access ID Key

AKIA[0-9A-Z]{16}

Secret Key

[0-9a-zA-Z/+]{40}

Google Cloud Platform

OAuth 2.0

[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}

API Key

[A-Za-z0-9_]{21}--[A-Za-z0-9_]{8}

Heroku

API Key

[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}

OAuth 2.0

[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}

OpenAI

User API Key

sk-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}

User Project Key

sk-proj-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}

Service ID

^[A-Za-z0-9]+(-*[A-Za-z0-9]+)*$

Service Key

sk-{SERVICE ID}-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}

regextokens's People

Contributors

acelewis avatar andrewrmillar avatar odomojuli avatar to-s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

regextokens's Issues

OpenAI Service-ID / Service-Key Format

This is the current expression for service-id:

^[A-Za-z0-9]+(-*[A-Za-z0-9]+)*$

I want to plug in the above expression into the below expression.

This is the current expression for service-key:

sk-{SERVICE ID}-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}

service-id can only contain alphanumeric [A-Za-z0-9] or any number of dashes -, but the last character cannot be a dash.
My idea is this:
First, initial chunk is always alphanumeric [A-Za-z0-9] of length 0-to-N.
Then, remaining chunks would be some combination of -, and [A-Za-z0-9].
Finally, the remaining chunks are captured by the greedy quantifier *.

Plugging this into the parent expression causes catastrophic backtracking.
I would like to avoid the recursive or the greedy approach for this reason.

Here are some test strings for service-id:

abc123
abc123-
-abc123
abc-123
abc--123
-abc-123
abc-123-
-abc-123-
-
--

Google OAuth Flow symmetrical across services

Preliminary overview of Google Services indicate OAuth Flow and API Key are symmetrical across various services such as Gmail, Drive, YouTube, Android, etc.

Redundant entries would be tedious to enumerate respective application.

Some entries are not consolidated and entered separately given varying degrees of risk and exposure in standard implementations.

Would appreciate any discussion on how to consolidate approach towards Google services.

Add source and verification to each regular expression using grep

Came across some regular expression variants in this twitter thread from 2020:
https://twitter.com/avicoder/status/1267857981925765120

Regular expressions may vary in usage but I would like to verify some samples against grep.
Not entirely sure I want to be pointing to existing codebases with real examples, since I find that in poor taste.
Would appreciate suggestions for posting verification of regular expressions.

A number of competing repositories either have invalid or deprecated expressions, this an informal attempt to at least update these sources in one place.

GitHub Access Token format

See recent pull request: #12

As of April 5th, 2021:
https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/

GitHub has introduced new formats for their personal access tokens (beta).

There should be several additional entries to cover usage.

These include variants that may for example invoke both a pattern for GitHub actions and the fine-grained personal access token associated with it.

Examples should be drawn as much as possible from the documentation.

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.