How can I escape the brackets so they are seen as literal characters I am using clientside validation along with the field UI module in a Drupal 7 site to request some custom input fields on user registration. I need to set some custom error messages using the clientside validation modulename_clientside_validation_rule_alter() function. The problem is, the field UI module creates fields with brackets in the name attribute like so: field_first_name[und][0][value]. When I use this as the first argument of _clientside_validation_set_required(), the proper error message is not being shown. I believe this is because the brackets are not seen as part of the string. How can I make the brackets literally brackets and not look like an array to drupal?
The problem wasn't the brackets—I was able to set the rule by referencing the nested #name and #value keys:

_clientside_validation_set_required(
      $element['field_first_name']['und']['0']['value']['#name'],
      $element['field_first_name']['und']['0']['value']['#title'],
      isset($element['field_first_name']['und']['0']['value']['#required']) ? $element['field_first_name']['und']['0']['value']['#required'] : FALSE,
      $js_rules,
      t('Please enter your @field_name.', array('@field_name' =&gt; strtolower($element['field_first_name']['und']['0']['value']['#title'])))
    );