JWT Token
intermediateMatches JSON Web Token strings in header.payload.signature format.
jwttokensecurityauthentication
Pattern
/eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+/gTry It
0 of 4 strings matched
Explanation
Matches JWT format: three base64url-encoded segments separated by dots. JWTs always start with 'eyJ' (base64 for '{"') in both header and payload.
Test Strings
Matching
- eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U
Non-matching
- not.a.jwt
- eyJ.short.token
- random-string
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);