-1

I'm not familiar with regex, but I have the following string

d.$filter = d.$filter.replace(/TutoringSince le '(.+?)'/g, "TutoringSince ge $1Z");

Is anybody know what does it mean this Z char after $1 ?

Alan Moore
  • 73,866
  • 12
  • 100
  • 156
BorHunter
  • 893
  • 3
  • 18
  • 44

2 Answers2

1

$1 is a reference to the first group - in this case: (.+?)

Z is just a Z letter.

hsz
  • 148,279
  • 62
  • 259
  • 315
0

It replaces the captured text in the d.$filter, with TutoringSince ge, plus itself then adds a Z. I.e. the text

TutoringSince le 'whatever'

would turn into

TutoringSince ge whateverZ

"The captured text" would be anything inside the single quotes.

SamWhan
  • 8,296
  • 1
  • 18
  • 45