forms – How can I add a pattern attribute to a phone field?

I am trying add pattern attribute to phone field of drupal‘s core feedback form. I am trying to do like this in mytheme.theme

function mytheme_form_alter(array &$form, FormStateInterface $form_state, $form_id) {

  if('contact_message_feedback_form' == $form_id){
    $form('field_phone')('#attributes')() = ('pattern' => '+(0-9)?()(0-9)(s|S)(d(0-9){9})');
   }
}

but pattern attribute not showing up (also cleared caches).
I am using 9.1.4.