Prabakaran Thamarai
Prabakaran Thamarai

Reputation: 3

Using AS3(actionscript3)regular expression i need to retrieve data between double quotes

I am having raw data like this --> function geoip_country_code(){return"IN"}function geoip_country_name(){return"India"}function geoip_city(){return"Chennai"}function geoip_region(){return"TN"}function geoip_region_name(){return"Tamil Nadu"}function geoip_latitude(){return"13.052414"}function geoip_longitude(){return"80.250825"}function geoip_postal_code(){return""}function geoip_area_code(){return"0"}function geoip_metro_code(){return"0"}

I need to retrieve the data between double quotes. That's i need IN,India,Chennai likewise.

I don't know RegExp. so anyone kindly give solution for this.

Thanks

Upvotes: 0

Views: 67

Answers (1)

deyhle
deyhle

Reputation: 473

The Regular Expression you're looking for is

/"([^"]*)"/

Explanation: match two quotes and any number (*) of characters in between that are not a quote (^"). The capture group (…) will return you the desired characters.

I don't know ActionScript too well, but String.match should be the right choice.

Upvotes: 1

Related Questions