blog-image-regex

(?=^((?!the text that should not be present).)+$)(^the text that should be present$)

Here is a Javascript snippet to check that a string does not contain two dashes (–) directly following each other:

var regex = /(?=^((?!--).)+$)(^[a-z\-]{1,10}$)/;
true === regex.test('abc-def');
true === regex.test('-abc-def-');
false === regex.test('abc--def');
false === regex.test('abc---def');