leftContext

The substring preceding the most recent match. $' is another name for the same property.

Property of

RegEx

Description

Because leftContext is static (read-only), it is not a property of an individual regular expression object. Instead, you always use it as RegExp.leftContext.