Ask coding questions

← Back to all posts
[JS] I need help understanding this code.
MisledWater79

I need help on specifically /(?<=\$\(CustomRank{Rank-Name: ).+?(?=}\))/g I don't know what it is and how I can edit it to something different but with similar function.

Voters
MisledWater79
Comments
hotnewtop
AzureDev

It is a JavaScript regex (regular expression). Here's the breakdown:

Mark if helped!

Coder100

That's regex. You can use regexr to parse it to explain it to you.

It will return what is in bold: (**CDT**)

First, it checks if there is a $(CustomRank{Rank-Name:. Then, it will match whatever is inside the curly braces. That's it!

InvisibleOne

I believe that is regex, but idk what isn't doing