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.

how to mask the full input but the last four number

See original GitHub issue

I would like to mask all the numbers but the last two. Like the following example:

IN:
123451234
    *****1234
12341234
   ****1234

I’ve tried the following unsuccessfully:

          <input matInput 
            mask="\(X\)*0000"
            [hiddenInput]="true"


          <input matInput 
            mask="X*0000"
            [hiddenInput]="true"


          <input matInput 
            mask="X{,}0{4}"
            [hiddenInput]="true"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aemongecommented, Sep 10, 2019

@AlexeyDolya that works with a seven digit input. I mean, if you input 12345678 you get the expected last two numbers to be the only ones visibles.

But, if you input a six o five digit number 12345; you won’t get the expected behaviour; you wouln’t see the last two digits, it will be masked.

The issue/improvment is to be able to apply mask from right to left, the same way is now working from left to right.

0reactions
ArturV93commented, Jan 12, 2022

Not the best solution, but you can use OR statement for mask.

<input [hiddenInput]=“true” mask=“XXX00 || XXXX00 || XXXXX00”>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regex mask last 4 numbers - Stack Overflow
Your current regex matches any digit that doesn't have four other digits immediately following it. Which is the case for every digit in...
Read more >
Control data entry formats with input masks - Microsoft Support
In the Field Properties area, click the Input Mask text box, and then type your custom mask. Press CTRL+S to save your changes....
Read more >
Solved: Input mask apply flexibility in character numbers?
I have a field that would get input values of two to three letters followed by one to four digits. The letters need...
Read more >
How to Use an Input Mask in Microsoft Access ... - YouTube
In this video, I will teach you how to use an Input Mask in your Microsoft Access tables and forms. We will create...
Read more >
How to show only the last 4 digits of social security number ...
1. Select all cells containing social security numbers, then click Kutools > Text > Remove by Position. 2. In the Remove by Position...
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