I have program:
var str = "ac.def=1 and xy.z.kt='10' and k.t=1 or xy.z.kt.lm='10'";
var regex = new RegExp('^[a-zA-Z0-9,]*[.]{1}[^=]');
var result = str.split(" ").filter((elem, index) => {
return regex.test(elem);
})
console.log(result);
I get result as: ["ac.def=1", "xy.z.kt='10'", "k.t=1", "xy.z.kt.lm='10'"]
but I need to get only : ["abc.def=1", "k.t=1"]
it is said that my question is possible duplicate of Learning Regular Expressions so lets close stackoverflow forever, because all questions about software programming has an answer in their own official documents.
Please be careful when marking a question as a possible duplicate of an official documents. Otherwise we should close all questions about regex since Learning Regular Expressions is enough to solve all problems about regex. Right?