Frage im Vorstellungsgespräch bei Meta

Implement a very basic regular expression checker which given a string and a regex, returns true or false. Should consider 'a'-'z','.', and '*'.

Antwort im Vorstellungsgespräch

Anonym

28. Okt. 2013

$regex = "/^[a-z\.\*]+$/"; $string = "something..."; return preg_match($regex, $string);