Skip to content

Allow RegularExpressions in PDSL directly  #56

@ryardley

Description

@ryardley

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
}`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions