identifier
Accepts and returns strings that are valid identifiers in most programming languages.Type Signature
Validation Pattern
Validates identifier naming conventions:- Must start with a letter (a-z, A-Z) or underscore (
_) - Followed by any combination of letters, digits (0-9), or underscores
- Case-insensitive
Valid Inputs
Invalid Inputs
Error Message
When validation fails:"Must be valid identifier"
Implementation
src/strings.ts:98-101
Use Cases
- Validating variable names in code generators
- Checking function or class names
- Ensuring database column/table names follow conventions
- Validating API parameter names
- Configuration key validation
Notes
- This pattern matches identifiers in languages like JavaScript, Python, Java, C++, etc.
- Does not validate against language-specific reserved keywords
- Does not allow Unicode identifiers (only ASCII)
- Does not allow dollar signs (
$), which are valid in some languages like JavaScript
Related Decoders
- regex - Create custom string pattern validators
- startsWith - Match strings with specific prefixes
- endsWith - Match strings with specific suffixes
