LOCALE_JS_OBJECT_CONTEXT
Same name and namespace in other branches
- 10 core/modules/locale/locale.module \LOCALE_JS_OBJECT_CONTEXT
- 11.x core/modules/locale/locale.module \LOCALE_JS_OBJECT_CONTEXT
- 9 core/modules/locale/locale.module \LOCALE_JS_OBJECT_CONTEXT
- 8.9.x core/modules/locale/locale.module \LOCALE_JS_OBJECT_CONTEXT
- 7.x includes/locale.inc \LOCALE_JS_OBJECT_CONTEXT
Regular expression to match an object containing a key 'context'.
Pattern to match a JS object containing a 'context key' with a string value, which is captured. Will fail if there are nested objects.
Deprecated
in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement.
See also
https://www.drupal.org/node/3568156
File
-
core/
modules/ locale/ locale.module, line 58
Code
define('LOCALE_JS_OBJECT_CONTEXT', '
\\{ # match object literal start
.*? # match anything, non-greedy
(?: # match a form of "context"
\'context\'
|
"context"
|
context
)
\\s*:\\s* # match key-value separator ":"
((?:(?:\'(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*")(?:\\s*\\+\\s*)?)+) # match context string
.*? # match anything, non-greedy
\\} # match end of object literal
');
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.