Posts by Lagaggio • 95 points
4 posts
-
1
votes1
answer95
viewsQ: A single regex for two different options
How can I use the regex twice type like this: let A = /^A2\d{8}.{26}\d{12}$ , ^A3\d{16}.{26}\d{15}$/; What would be the way to use it to A2 and A3 without having to use regex twice, like: let A =…
-
1
votes2
answers253
viewsQ: Check if a string matches multiple conditions
I would like to know how I do to check the following code: if((lines[line].substr(0,2) == "N1" && lines[line].length == 94 && lines[line].substr(3,16) == /[0-9]/ &&…
-
1
votes1
answer54
viewsQ: Find a string
I have the following Javascript function: document.addEventListener("DOMContentLoaded", function(){ document.getElementById('file').onchange = function() { var extPermitidas = ['txt']; var…
javascriptasked Lagaggio 95 -
3
votes1
answer158
viewsQ: Read file line by line and collect strings
I have these two functions in Javascript: function verificaExtensao($input) { var extPermitidas = ['txt']; var extArquivo = $input.value.split('.').pop(); if(typeof extPermitidas.find(function(ext){…