R

TestRegex

Contents before match

$`

This will return a portion of the source string that precedes the match.

Examples

JAVASCRIPT

Share & Embed

Use this snippet to display this token on your own site.

<!-- Embed Regex Token: $` -->
<code class="regex-token">$`</code> - Contents before match
<small><a href="https://testregex.com/cheatsheet/contents-before-match">See details</a></small>