question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom pattern optional character

See original GitHub issue

I’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:open
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
sollennecommented, Jul 11, 2019

Why is this closed? I’m seeing the same issue… Check out his stackblitz link

9reactions
ValeriaKochegarovacommented, Apr 10, 2019

@Yokhtop please update new mask version and add in your component customPatterns = { V: { pattern: new RegExp(“-?”) }, 0: { pattern: new RegExp(“[0-9]”) } };

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found