Lua need to split at comma

Try this str=”cat,dog” for word in string.gmatch(str, ‘([^,]+)’) do print(word) end ‘[^,]’ means “everything but the comma, the + sign means “one or more characters”. The parenthesis create a capture (not really needed in this case).

Javascript Regexp loop all matches

I agree with Jason that it’d be faster/safer to use an existing Markdown library, but you’re looking for String.prototype.replace (also, use RegExp literals!): var Text = “[Text Example][1]\n[1][http: //www.example.com]”; var rePattern = /\[(.+?)\]\[([0-9]+)\]/gi; console.log(Text.replace(rePattern, function(match, text, urlId) { // return an appropriately-formatted link return `<a href=”https://stackoverflow.com/questions/5835418/${urlId}”>${text}</a>`; }));

JavaScript error: “val.match is not a function”

I would say that val is not a string. I get the val.match is not function error for the following var val=12; if(val.match(/^s+$/) || val == “”){ document.write(“success: ” + val); } The error goes away if you explicitly convert to a string String(val) var val=12; if(String(val).match(/^s+$/) || val == “”){ document.write(“success: ” + val); … Read more

What does the “Nothing to repeat” error mean when using a regex in javascript?

You need to double the backslashes used to escape the regular expression special characters. However, as @Bohemian points out, most of those backslashes aren’t needed. Unfortunately, his answer suffers from the same problem as yours. What you actually want is: The backslash is being interpreted by the code that reads the string, rather than passed … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)