Posts by motobói • 711 points
4 posts
-
2
votes3
answers4221
viewsA: Take only the values before the character "=" using regular expression?
Depending on what you want to do, you might want to use the split to break the string into two. Javascript: var linha = "Maringa=123123"; var resultado = linha.split("='); $resultado is now an array…
-
6
votes7
answers44529
viewsA: How to get only the numbers of a string in Javascript?
I don’t know if my solution is better than the others, but it seems simpler, at least: $string = "l337 5tr1ng"; $num = parseInt($string.match(/\d/g).join('')); The match looking for numbers (\d),…
-
42
votes5
answers52381
viewsA: Regular expression to detect credit card flag
Credit card numbers follow an international standard called IEC-7812. Basically, the first six digits of the card are Issuer Identifier number (IIN) (Issuer Identification Number). So, you don’t…
-
8
votes4
answers309
viewsA: How to deal with a comet process?
Use the sign SIGSTOP. The signals manual is available (in English) at: man 7 signals I send the signal SIGSTOP for all processes with that same name using the command killall -SIGSTOP cmd then kill…