I'm new with all the LWC topic. But for now I'm having issues with some regex. To Begin with I have my own LWC created with a few fields some of them are type number such this one:
<lightning-input label="CCV" type="number" value={valueCvv} onchange={handleCvvChange} id="card-ccv" maxlength="3"></lightning-input>
From what I'm trying to do in this case CCV is for the input only accept numbers (0-9). But for now is accepting them but also this characters ´ + , . -. Here is the event:
handleCvvChange(event){
this.valueCvv = event.target.value;
event.detail.value = event.detail.value.replace(/^([0-9])*$/,'');
}
Thanks in advance!