regex - Regular expression to get string between string to particular position number -
i have tried capture string between start , end characters
example:
string: input type="hidden" title="tzdetect.pref.tzid" value="asia/kolkata"
starts with: title="tzdetect.pref.tzid" value="
ends with: "
regular expression: (?<=title="tzdetect.pref.tzid" value=")(.*?)(?=")
result: asia/kolkata
now, i'm trying string between start character particular position number.
example:
string: input type="hidden" title="tzdetect.pref.tzid" value="asia/kolkata"
starts with: title="tzdetect.pref.tzid" value="
ends with: 12th or 13th character
result should be: asia/kolkata (if 12) or asia/kolkata" (if 13)
how achieve this?
Comments
Post a Comment