I have to test a string like this one in javascript:
var str = "eleme_eus = \'Generikoa_Erlijioa\' or eleme_eus like \'Eliza_igles_a\' or eleme_eus like \'Parroki_a\' or eleme_eus like \'Erm_ita\' or eleme_eus like \'Komen_tua\' or eleme_eus like \'Santutegia\'";
I've been trying to create a regex to do so, but I cannot pass the \' part.
For now, I have (working):
var regex = /\w\s(=|like)\s/;
After that, I've tried scaping the backslash, the quotation mark... always false.
I just need to get to the "or/and" part, after that it repeats itself.
Thank you in advance.
EDIT:
With both websites (thx), I've come to this expression:
\w+[-\w]*\s(=|like)\s\\\'\w+\\\'(\s(and|or)\s\w+[-\w]*\s(=|like)\s\\\'\w+\\\')*
but if I test it in the console (Chrome)...
regex.test("field-name like \'word\' or field-name like \'word_word\'");

