-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
  • 71,299
  • 12
  • 93
  • 154
BorHunter
  • 881
  • 2
  • 18
  • 41

2 Answers2

1

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

Z is just a Z letter.

hsz
  • 143,040
  • 58
  • 252
  • 308
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,166
  • 1
  • 16
  • 44