Skip to content

toGlobalRegExp

Copies a regular expression with the g flag set, so matching never moves the caller’s lastIndex.

Import:

import { toGlobalRegExp } from '@mnaoumov/obsidian-lib/codemirror/inline-token-widgets';

Signature:

function toGlobalRegExp(regExp: RegExp): RegExp

Parameters:

Parameter Type Description
regExp RegExp The regular expression.

Returns: RegExp — A global copy of the regular expression.