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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -