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

Allow RegularExpressions in PDSL directly #56

Open
ryardley opened this issue Sep 25, 2019 · 0 comments
Open

Allow RegularExpressions in PDSL directly #56

ryardley opened this issue Sep 25, 2019 · 0 comments

Comments

@ryardley
Copy link
Owner

ryardley commented Sep 25, 2019

If Regular Expressions could be added directly to the p-expression we would save some considerable space and increase legability:

// interpolated Regular Expressions
const isUser = p`{
  username: string & !${/[0-9A-Z]/} & { length: 4..8 },
  password: string & !${/[a-zA-Z0-9]/} & { length: > 8 },
  age: > 17
}`;

// input Regular Expressions directly
const isUser = p`{
  username: string & !/[0-9A-Z]/ & { length: 4..8 },
  password: string & !/[a-zA-Z0-9]/ & { length: > 8 },
  age: > 17
}`;
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

1 participant