i need some help to work with regex on ngx Mask.
I'm trying to set a mask to my Lat,Lon google coords input with a custom regex.
-5.57455948, -70.5165755
This Regex fit the entire input:
/^([-+]?[1-8]?\d(?:\.\d+)?|90(?:\.0+)?),\s*([-+]?(?:180(?:\.0+)?|(?:(?:1[0-7]\d)|(?:[1-9]?\d))(?:\.\d+)?))$/
Test for regex: Regex101.com
My .ts code
customPatterns = {
'l': { pattern: new RegExp('/^([-+]?[1-8]?\d(?:\.\d+)?|90(?:\.0+)?),\s*([-+]?(?:180(?:\.0+)?|(?:(?:1[0-7]\d)|(?:[1-9]?\d))(?:\.\d+)?))$/') }
};
My html code:
<input id="coordenadas_iniciais" placeholder="-22.4567,-45.2345" matInput
formControlName="coordenadas_iniciais" showMaskTyped="true" mask='l' [patterns]="customPatterns" required>
This not work.