Q:

Javascript - Do not run function if past date present

I have a Javascript function that draws an orbit on a Google Map. This is the function in question:
var stations;
var sats = [];
var lines = [];
var i = 0;
$('.tle-data-main').each(function() {
    lines.push(this.innerText);
});
var data = lines.join("\n");
stations = orbits.util.parseTLE(data);

for (; i < stations.length; i++) {
    var name = stations[i].name;
    var satOpts = {
        map: map,
        tle: stations[i],
        pathLength: 3,
    };

    var sat = new orbits.Satellite(satOpts);
    sat.refresh();
    sat.refresh_path();
    sats.push(sat);
}

This takes some numbers from the class .tle-data-main, does a few calculations and displays the results. That function works perfectly. (The orbit drawer uses the orbits.js library).
The only problem is, that I want to not run this function when there is a date present in my 'Decay' section. If there is a date, I do not want the function to run since it has decayed. I only want it to run if there is no date present. 
So my 'Decay' HTML can either be this:
<li><span id="decay">Decay: </span>2017-07-03</li>

or like this:
<li><span id="decay">Decay: </span>In Orbit (No Decay Date)</li>

I have tried to look for some tutorials/examples that use this, but could not find any. 
TL;DR Do not run my Javascript function if date present.

A:

You can check #decay DOM element .nextElement.textContent for pattern /\d{4}-\d{2}-\d{2}/ using RegExp.prototype.test() to match four digits followed by "-" followed by two digits followed by "-" followed by two digits

if (/\d{4}-\d{2}-\d{2}/.test($("#decay")[0].nextSibling.textContent)) {
  console.log("do not run function")
} else {
  // do stuff
  console.log("run function")
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li><span id="decay">Decay: </span>2017-07-03</li>
</ul>

if (/\d{4}-\d{2}-\d{2}/.test($("#decay")[0].nextSibling.textContent)) {
  console.log("do not run function")
} else {
  // do stuff
  console.log("run function")
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li><span id="decay">Decay: </span>In Orbit (No Decay Date)</li>
</ul>

