fork(68) download
  1. var text = 'abc.def';
  2. var pattern = /^[a-z]+([\.\-]?[a-z]+)?$/;
  3. if (text.match(pattern)) {
  4. print("YES!");
  5. } else {
  6. print("NO!");
  7. }
Success #stdin #stdout 0.01s 4984KB
stdin
Standard input is empty
stdout
YES!