The DOI system places basically no useful limitations on what constitutes a reasonable identifier. However, being able to pull DOIs out of PDFs, web pages, etc. is quite useful
CrossRef has a recommendation, that they tested successfully on 99.3% of DOIs (known to them):
/^10.\d{4,9}/[-._;()/:A-Z0-9]+$/i