Posts by Alexander Mashin • 166 points
3 posts
-
1
votes1
answer44
viewsA: Regex to catch only one occurrence of the right equerda
Simply remove the \s and redundant parentheses, unless their regular expression is a capture in a larger: (?:[0-9]{1,3}\.){3}[0-9]{1,3}(?=\s|\)|$). Also add an advance statement (?=\s|\)|$) to…
regexanswered Alexander Mashin 166 -
0
votes2
answers150
viewsA: Regex to remove the comma with a previous space
novoArray = novoArray.toString().replace(/,(?!\d)/g, "").
-
4
votes2
answers68
viewsA: Comparison of numbers read with "io.read()" does not result in true as expected
Must be: x = io.read() if x ~= '0' then print (x .. ' deferente do 0') end if x == '1' then print (x .. ' igual a 1') end io.read() returns strings.…