-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
  • 68,531
  • 11
  • 88
  • 149
BorHunter
  • 871
  • 2
  • 18
  • 39

2 Answers2

1

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

Z is just a Z letter.

hsz
  • 136,835
  • 55
  • 236
  • 297
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,038
  • 1
  • 14
  • 42