Re-use value entered in component in previous webform page on following page in markup
For one I would be wary of matching $form_id like that.
It means you will be altering any webform you might add in future.
Plus it is possible for other form id's to contain webform, for example webform_node_form, which is the node add/edit form for the webform content type.
There is also webform_components_form, webform_component_edit_form and probably lots of others.

If you really want to regex it I would use webform_client_form_\d+

However if I wanted to do all webforms I would use hook_form_BASE_FORM_ID_alter(), like this:


/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */
function hook_form_webform_client_form_alter(&amp;$form, &amp;$form_state, $form_id) {

}


and to do just one webform I would use hook_form_FORM_ID_alter(), like this:



/**
 * Implements hook_form_FORM_ID_alter().
 */
function hook_form_webform_client_form_922_alter(&amp;$form, &amp;$form_state) {

}


Now for your actual question, you can accomplish this in form alter:



/**
 * Implements hook_form_FORM_ID_alter().
 */
function hook_form_webform_client_form_922_alter(&amp;$form, &amp;$form_state) {
  // If we are on the second page.
  if ($form['details']['page_num']['#value'] == 2) {
    // You can get the value via the submitted_tree using the field key.
    $name = $form_state['values']['submitted_tree']['name_field_key'];
    // However I would recommend instead using submitted.
    // The reason is that with fieldsets the submitted_tree gets more complex,
    // and also, users can change the field key (who knows why that's allowed)
    // so that is unreliable. The submitted array uses the webform field cid
    // so it won't change.
    // (1 is the id of my name field)
    $name = $form_state['values']['submitted'][1];

    // There are 2 main ways you can add the markup.
    // 1. If you actually have a webform markup component on the second page
    // and you want to set its value. This means you can control the field via
    // the webform UI.
    // I use check plain because this is data entered by the user and needs to
    // be sanitised. You could also use filter_xss() if the field might
    // contain HTML.
    $form['submitted']['markup_field_key']['#markup'] = '&lt;div class="my-markup-field"&gt;' . check_plain($name) . '&lt;/div&gt;';
    // 2. If you don't have a webform markup component and just want to add
    // markup in, you can do this, just using regular form API.
    $form['submitted']['my_markup_field'] = array(
      // Defaults to type #markup.
      '#markup' =&gt; '&lt;div class="my-markup-field"&gt;' . check_plain($name) . '&lt;/div&gt;',
      '#weight' =&gt; 10,
    );
  }
}