Created
October 11, 2016 19:32
-
-
Save andre-f-paggi/94608df85b4d7ab42ee808fa7f55915a to your computer and use it in GitHub Desktop.
Regex test in JS removeAntesDosNumeros e remove possíveis espaços vazios em dobro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var regexRemoveAntesDosNumeros = new RegExp(/(\D*)(\d*)*(\,(\d|\ )*)/g); | |
this.value = this.value.replace(regexRemoveAntesDosNumeros, "$2$3$4").replace(/\s+/g,' '); // Remove possíveis espaços vazios em dobro | |
// test string = a, 595, 535, 563 abc, 523 abcacascas ,543123 | |
// test site https://regex101.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment