You are here

function wysiwyg_wrap_js_regexp in Wysiwyg 5.2

Same name and namespace in other branches
  1. 6.2 wysiwyg.module \wysiwyg_wrap_js_regexp()
  2. 7.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

2 calls to wysiwyg_wrap_js_regexp()
hook_INCLUDE_plugin in ./wysiwyg.api.php
Define a Wysiwyg plugin.
hook_wysiwyg_plugin in ./wysiwyg.api.php
Return an array of native editor plugins.

File

./wysiwyg.module, line 967
Integrate client-side editors with Drupal.

Code

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