Custom pattern optional character
See original GitHub issueI’m trying to create mask for optional negative decimal number.
This doesn’t work: https://stackblitz.com/edit/angular-9mdtqs
Any symbol can be written to the first place. optional
boolean option does nothing
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
make characters optional in regular expression - Stack Overflow
Optionally the character '1'; Exactly ten digits; The end of the string. Look at the documentation for Pattern for more details. For example,...
Read more >perlre - Perl regular expressions - Perldoc Browser
You can define your own custom character classes, by putting into your pattern in the appropriate place(s), a list of all the characters...
Read more >Optional (?) - RegExr
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >Regular expressions
Matching multiple characters. There are a number of patterns that match more than one character. You've already seen . , which matches any...
Read more >Learn Regular Expressions - Lesson 8: Characters optional
This metacharacter allows you to match either zero or one of the preceding character or group. For example, the pattern ab?c will match...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Why is this closed? I’m seeing the same issue… Check out his stackblitz link
@Yokhtop please update new mask version and add in your component customPatterns = { V: { pattern: new RegExp(“-?”) }, 0: { pattern: new RegExp(“[0-9]”) } };