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

Add Regex String Types #43048

Closed
NightshadeX9X opened this issue Mar 2, 2021 · 1 comment
Closed

Add Regex String Types #43048

NightshadeX9X opened this issue Mar 2, 2021 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@NightshadeX9X
Copy link

Add Regex String Types

⭐ Suggestion

I'd like to see Regex types be added into typescript. This would allow us to create types for specific necessary strings. I feel like adding template literal types was a step in the right direction, but this would be even better.

📃 Example

type AllUppercase = /^[A-Z]+$/;

let myLowercaseVariable: AllUppercase = "test"; // error
let myUppercaseVariable: AllUppercase = "TEST"; // works
@MartinJohns
Copy link
Contributor

Duplicate of #41160. Used search terms: regex in:title

You forgot to fill out the issue template.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants