31
rated 0 times
[
33]
[
2]
/ answers: 1 / hits: 19922
/ 11 Years ago, fri, may 31, 2013, 12:00:00
I am dealing with timezone's in Javascript and I need a regex that will extract everything, but the timezone name from it. For example, I have the timezone America/Argentina/Buenos_Aires
. I want to extract the America/Argentina
part with a regex. Currently I have this regex: tz.match(/.*?(?=/|$)/i)[0]
which extracts everything to the first backslash which works for most timezones (America/Los_Angeles
), but not for all of them. How could I edit that regex so that it gets the string before the last value?
More From » regex