Home > Net >  extract countries data from sql using regex
extract countries data from sql using regex

Time:06-09

I got SQL for inserting countries, I just want to save some columns instead of all columns in the SQL query.

I have cleaned the data using regex but facing only one little problem. The regex doesn't match if the values are starting in the same line, I am using regex101.com for replacing

Try it here.


My Regex

(\(([0-9]),(['a-zA-Z ]*),(['a-zA-Z ]*)).*

Sample data

(1,'Afghanistan','AFG','004','AF','93','Kabul','AFN','Afghan afghani','؋','.af','افغانستان','Asia','Southern Asia','[{\"zoneName\":\"Asia/Kabul\",\"gmtOffset\":16200,\"gmtOffsetName\":\"UTC 04:30\",\"abbreviation\":\"AFT\",\"tzName\":\"Afghanistan Time\"}]','{\"kr\":\"아프가니스탄\",\"br\":\"Afeganistão\",\"pt\":\"Afeganistão\",\"nl\":\"Afghanistan\",\"hr\":\"Afganistan\",\"fa\":\"افغانستان\",\"de\":\"Afghanistan\",\"es\":\"Afganistán\",\"fr\":\"Afghanistan\",\"ja\":\"アフガニスタン\",\"it\":\"Afghanistan\",\"cn\":\"阿富汗\",\"tr\":\"Afganistan\"}',33.00000000,65.00000000,'           
  • Related