You don't need a regex for this, most languages have an indexOf
or similar that looks for a literal string and returns the index of the first occurrence. But if you need a regex, it's probably just --
(depending on your flavor of regex), because outside of a []
construct, -
doesn't have a special meaning.
JavaScript examples (you didn't mention what language you were using):
// Find the index of the first occurrence of "--":
if ((n = theString.indexOf("--")) >= 0) {
// It contains them starting at index 'n'
}
// Using string.match, which checks a string to see if it contains
// a match for a regex:
if (theString.match(/--/)) {
// Yes it does
}