scripting : use pattern matching