query: SELECT ?item ?itemLabel ?value ?result (STRLEN(STR(?value)) AS ?stringlength)  ?snak ?rank WHERE {
  	{
  		SELECT ?item ?value ?result ?snak ?rank WHERE {
  			{
  				?item p:P281 [ ps:P281 ?value; wikibase:rank ?rank ] .
  				BIND("mainsnak" AS ?snak) .
  			} UNION {
  				?statement1 pq:P281 ?value;
  					wikibase:rank ?rank .
  				?item ?p1 ?statement1 .
  				BIND("qualifier" AS ?snak) .
  			} UNION {
  				?ref pr:P281 ?value .
  				?statement2 prov:wasDerivedFrom ?ref;
  					wikibase:rank ?rank .
  				?item ?p2 ?statement2 .
  				BIND("reference" AS ?snak) .
  			} .
  			BIND( REGEX(STR(?value), "^((\\d{6}(–\\d{6})?)|(\\d{5}(–\\d{5})?)|(\\d{4}(–\\d{4})?)|(\\d{3&#125;-\\d{4}(–\\d{3&#125;-\\d{4})?)|(\\d{4})|(([1-3][0-9]|4[0-3])\\d{2})|(\\d{4}[A-Z]{2})|(\\d{5}(-\\d{4})?)|(\\d{2}(\\d{3})?)|((GIR 0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKPSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))))( [0-9][ABD-HJLNP-UW-Z]{2})?))|(\\d{5}(-\\d{3})?)|(\\d{3} \\d{2}(–\\d{3} \\d{2})?)|([A-Z]\\d{4}([A-Z]{3})?)|(\\d{4} [A-Z]{2}?)|([০১২৩৪৫৬৭৮৯0-9]{4})|(\\d{2&#125;-\\d{3}(–\\d{2&#125;-\\d{3})?)|(LT-\\d{5})|(LV-\\d{4})|(MD-\\d{4})|(AD\\d{3})|(AZ\\d{4}))$") AS ?regexresult ) .
  			FILTER( ?regexresult = false ) .
  			BIND( IF(?regexresult = true, "pass", "fail") AS ?result ) .
  			FILTER( ?item NOT IN (wd:Q4115189, wd:Q13406268, wd:Q15397819) ) .
  		} LIMIT 100
  	} .
  	SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en" } .
  }
  #ORDER BY ?rank ?snak ?value
  #PLEASE NOTE: This is experimental and may only work for simple patterns.
  #Tests may fail due to:
  #(1) differences in regex format between SPARQL (https://www.w3.org/TR/xpath-functions/#regex-syntax) and PCRE (used by constraint reports). Don't change the regex to work with SPARQL!
  #(2) some bug in the link that brought you here
  #Known to fail: P227 (multiple curly braces), P274, P281