I am going nuts on this for a few days now. I have read and tried many previously answered questions close to this topic, I've fiddled with all kinds of expressions on regexr.com (very awesome page BTW) but I can't for the life of me figure it out.
Some elements are for text input without spaces and allowed numbers (abc1_d-ef), some for free text (abc. d2ef, gh6i? j8kl: mno!), some for integers (123), some for decimals (1,2 / 1.2).
BUT I want to always forbid a newline character or tab (\n \r \t \f).
var pattern = new RegExp(.........);
var text = $("#my-id").html();
var test = pattern.test(text);
// test should be true for correct text / integer / decimal
// but should be false as soon as text contains a newline, tab etc.