You are here

function wysiwyg_wrap_js_regexp in Wysiwyg 7.2

Same name and namespace in other branches
  1. 5.2 wysiwyg.module \wysiwyg_wrap_js_regexp()
  2. 6.2 wysiwyg.module \wysiwyg_wrap_js_regexp()

Create a placeholder structure for JavaScript RegExp objects.

Parameters

$regexp: A JavaScript Regular Expression as a string, without / wrappers.

$modifiers: An optional string with modifiers for the RegExp object.

Return value

An array with placeholder information for creating a JavaScript RegExp object on the client.

Related topics

1 call to wysiwyg_wrap_js_regexp()
hook_wysiwyg_editor_settings_alter in ./wysiwyg.api.php
Act on editor profile settings.

File

./wysiwyg.module, line 1406

Code

function wysiwyg_wrap_js_regexp($regexp, $modifiers = NULL) {
  $obj = array(
    'drupalWysiwygType' => 'regexp',
    'regexp' => $regexp,
  );
  if ($modifiers) {
    $obj['modifiers'] = $modifiers;
  }
  return $obj;
}