Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

python regex not returns any things

I have this string to extract data form it:
this string extracted from <script> tag in a web page
I have tried to use regex to extract part of data i need.

'''
var FancyboxI18nClose = 'Close';
var FancyboxI18nNext = 'Next';
var FancyboxI18nPrev = 'Previous';
var ajaxsearch = true;
var baseAPIV1 = 'v1/';
var baseAPIV2 = 'v2/';
var baseDir = 'https://www.banimode.com/';
var baseUri = 'https://www.banimode.com/';
var baseUriAPI = 'https://mobapi.banimode.com/api/';
var color_value = '#990034';
var contentOnly = false;
var currency = {"id":1,"name":"Toman","iso_code":"TMN","iso_code_num":"364","sign":"\u062a\u0648\u0645\u0627\u0646","blank":"1","conversion_rate":"1.000000","deleted":"0","format":"4","decimals":"0","active":"1","prefix":"","suffix":" \u062a\u0648\u0645\u0627\u0646","id_shop_list":null,"force_id":false};
var currencyBlank = 1;
var currencyFormat = 4;
var currencyRate = 1;
var currencySign = 'تومان';
var displayList = false;
var highDPI = false;
var id_lang = 1;
var instantsearch = false;
var isGuest = 0;
var isLogged = 0;
var isMobile = false;
var page_name = 'product';
var priceDisplayMethod = 1;
var priceDisplayPrecision = 0;
var product = '{"product_price":199000,"product_specific_price":null,"in_flash_sales":false,"product_name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","product_manufacturer_name":"Brand Payless","product_category_size_guide":null,"colors":[{"id_product_attribute":365871,"has_product_set":0,"product_sets":[],"link":"BM-53620\/\u067e\u06cc\u0631\u0627\u0647\u0646-\u0645\u0631\u062f\u0627\u0646\u0647-\u0631\u0627\u0647-\u0631\u0627\u0647-\u0628\u0631\u0646\u062f-\u067e\u06cc-\u0644\u0633-brand-payless-\u06a9\u062f-b218.html#\/\u0631\u0646\u06af-\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","color_name":"\u0633\u0641\u06cc\u062f \u0632\u0631\u0634\u06a9\u06cc","id_color":2021,"color_slug":"\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","quantity":10,"color_value":"#990034","zoom":["https:\/\/www.banimode.com\/659063\/53620.jpg","https:\/\/www.banimode.com\/603021\/53620.jpg","https:\/\/www.banimode.com\/659065\/53620.jpg","https:\/\/www.banimode.com\/603022\/53620.jpg"],"values":["https:\/\/www.banimode.com\/659063-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/603021-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/659065-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/603022-thickbox_default\/53620.jpg"],"size":[{"name":"S","quantity":5,"id_product_attribute":365875,"reference":"00NB218STR1RED00000S"},{"name":"M","quantity":5,"id_product_attribute":365874,"reference":"00NB218STR1RED00000M"},{"name":"L","quantity":5,"id_product_attribute":365873,"reference":"00NB218STR1RED00000L"},{"name":"XL","quantity":0,"id_product_attribute":365872,"reference":"00NB218STR1RED0000XL"},{"name":"XXL","quantity":5,"id_product_attribute":365871,"reference":"00NB218STR1RED0002XL"}],"videos":[],"new_size_chart_support":true,"id_product":53620}]}';
var productCategoryID = 1938;
var productCur = {"id_product":53620,"id_product_attribute":365871,"id_color":2021,"reference":"00NB218STR1RED0002XL","link":"BM-53620\/\u067e\u06cc\u0631\u0627\u0647\u0646-\u0645\u0631\u062f\u0627\u0646\u0647-\u0631\u0627\u0647-\u0631\u0627\u0647-\u0628\u0631\u0646\u062f-\u067e\u06cc-\u0644\u0633-brand-payless-\u06a9\u062f-b218.html#\/\u0631\u0646\u06af-\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","product_name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","product_meta_title":"\u0642\u06cc\u0645\u062a \u0648 \u062e\u0631\u06cc\u062f \u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 \u06a9\u062f B218 | \u0628\u0627\u0646\u06cc \u0645\u062f","product_meta_description":"\u062e\u0631\u06cc\u062f \u0627\u06cc\u0646\u062a\u0631\u0646\u062a\u06cc \u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633  \u06a9\u062f B218 \u0648 \u0642\u06cc\u0645\u062a \u0627\u0646\u0648\u0627\u0639 \u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u062f\u0631 \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0622\u0646\u0644\u0627\u06cc\u0646 \u0628\u0627\u0646\u06cc \u0645\u062f. \u062c\u062f\u06cc\u062f\u062a\u0631\u06cc\u0646 \u0648 \u0634\u06cc\u06a9\u200c\u062a\u0631\u06cc\u0646 \u0645\u062f\u0644\u200c\u0647\u0627\u06cc \u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0627\u0633\u067e\u0631\u062a.","product_meta_keywords":"","product_link_rewrite":"\u067e\u06cc\u0631\u0627\u0647\u0646-\u0645\u0631\u062f\u0627\u0646\u0647-\u0631\u0627\u0647-\u0631\u0627\u0647-\u0628\u0631\u0646\u062f-\u067e\u06cc-\u0644\u0633-brand-payless-\u06a9\u062f-b218","product_description":"","product_description_short":"<div><\/div>\n<ul class=\"custom-style-line\">\n<li><strong>\u0627\u06cc\u0646 \u0645\u062d\u0635\u0648\u0644 \u0627\u0632 \u0627\u0646\u062f\u0627\u0632\u0647 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u06cc\u06a9 \u0633\u0627\u06cc\u0632 \u06a9\u0648\u0686\u06a9 \u062a\u0631 \u0627\u0633\u062a.<\/strong><\/li>\n<li><strong>\u0646\u0631\u0645\u06cc \u0648 \u0632\u0628\u0631\u06cc:<\/strong>\u00a0\u062e\u06cc\u0644\u06cc \u0646\u0631\u0645<\/li>\n<li><strong>\u0636\u062e\u0627\u0645\u062a \u067e\u0627\u0631\u0686\u0647: <\/strong>\u06a9\u0645<\/li>\n<li><strong>\u062c\u0632\u0626\u06cc\u0627\u062a \u0645\u062f\u0644:<\/strong>\u00a0\u06cc\u0642\u0647 \u062f\u06a9\u0645\u0647 \u062f\u0627\u0631 \u0645\u062f\u0644 Button Down\u060c \u0633\u0631\u0622\u0633\u062a\u06cc\u0646 \u0628\u0647 \u0641\u0631\u0645 \u0635\u0627\u0641\u00a0\u0645\u062f\u0644 1Button\u060c \u06a9\u0627\u062a \u0647\u0644\u0627\u0644\u06cc\u060c \u06cc\u0648\u06a9 \u0627\u0641\u0642\u06cc \u0648 \u0633\u0627\u0633\u0648\u0646 \u062f\u0631 \u067e\u0634\u062a<\/li>\n<li><strong>\u0642\u062f \u067e\u06cc\u0631\u0627\u0647\u0646:<\/strong>\u00a0\u0628\u0631\u0627\u06cc \u0633\u0627\u06cc\u0632 M\u060c\u00a0\u062f\u0631 \u062d\u062f\u0648\u062f\u00a076 \u0633\u0627\u0646\u062a\u06cc \u0645\u062a\u0631<\/li>\n<li><strong>\u0642\u062f \u0645\u062f\u0644 183 \u0633\u0627\u0646\u062a\u06cc \u0645\u062a\u0631\u060c \u0648\u0632\u0646 80 \u06a9\u06cc\u0644\u0648\u06af\u0631\u0645 \u0648 \u0633\u0627\u06cc\u0632 L \u067e\u0648\u0634\u06cc\u062f\u0647 \u0627\u0633\u062a.<\/strong><\/li>\n<\/ul>","product_price":199000,"product_reference":"BP-B218","product_manufacturer_name":"\u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633","product_manufacturer_en_name":"Brand Payless","product_manufacturer_logo":"https:\/\/www.banimode.com\/img\/m\/473-brand-136x69.jpg","product_manufacturer_title":"\u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 - BrandPayless | \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a\u06cc \u0628\u0627\u0646\u06cc \u0645\u062f","product_manufacturer_id":473,"product_manufacturer_slug":"\u0628\u0631\u0646\u062f_\u067e\u06cc_\u0644\u0633","product_specific_price":null,"product_category_default_id":1938,"has_related_category":0,"related_category":[],"has_product_set":0,"product_sets":[],"color_name":"\u0633\u0641\u06cc\u062f \u0632\u0631\u0634\u06a9\u06cc","color_slug":"\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","color_value":"#990034","breadcrumbs":[{"name":"\u0647\u0645\u0647 \u0645\u062d\u0635\u0648\u0644\u0627\u062a","id":2},{"name":"\u0645\u0631\u062f\u0627\u0646\u0647","id":829},{"name":"\u0644\u0628\u0627\u0633 \u0645\u0631\u062f\u0627\u0646\u0647","id":3},{"name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647","id":11},{"name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0622\u0633\u062a\u06cc\u0646 \u0628\u0644\u0646\u062f \u0645\u0631\u062f\u0627\u0646\u0647","id":1630},{"name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0622\u0633\u062a\u06cc\u0646 \u0628\u0644\u0646\u062f \u0631\u0627\u0647 \u0631\u0627\u0647 \u0645\u0631\u062f\u0627\u0646\u0647","id":1938}],"product_features":[{"title":"\u06cc\u0642\u0647","value":"\u0645\u0631\u062f\u0627\u0646\u0647"},{"title":"\u0622\u0633\u062a\u06cc\u0646","value":"\u0628\u0644\u0646\u062f"},{"title":"\u0637\u0631\u062d","value":"\u0631\u0627\u0647\u200c\u0631\u0627\u0647"},{"title":"\u0646\u062d\u0648\u0647 \u0628\u0633\u062a\u0647\u200c\u0634\u062f\u0646","value":"\u062f\u06a9\u0645\u0647"},{"title":"\u062c\u06cc\u0628","value":"\u0646\u062f\u0627\u0631\u062f"},{"title":"\u0642\u0648\u0627\u0631\u0647","value":"\u0645\u062a\u0646\u0627\u0633\u0628"},{"title":"\u0646\u0648\u0639 \u0634\u0633\u062a\u0634\u0648","value":"\u062f\u0633\u062a\u06cc \/ \u0645\u0627\u0634\u06cc\u0646\u06cc"},{"title":"\u0646\u062d\u0648\u0647 \u0634\u0633\u062a\u0634\u0648","value":"\u0628\u0647 \u0635\u0648\u0631\u062a \u0645\u062c\u0632\u0627 \u06cc\u0627 \u0628\u0627 \u0631\u0646\u06af\u200c\u0647\u0627\u06cc \u0645\u0634\u0627\u0628\u0647"},{"title":"\u0645\u0627\u06a9\u0632\u06cc\u0645\u0645 \u062f\u0645\u0627\u06cc \u0634\u0633\u062a\u0634\u0648","value":"30 \u062f\u0631\u062c\u0647 \u0633\u0627\u0646\u062a\u06cc\u200c\u06af\u0631\u0627\u062f"},{"title":"\u0627\u062a\u0648\u06a9\u0634\u06cc","value":"\u062f\u0627\u0631\u062f"},{"title":"\u0645\u0627\u06a9\u0632\u06cc\u0645\u0645 \u062f\u0645\u0627\u06cc \u0627\u062a\u0648\u06a9\u0634\u06cc","value":"130 \u062f\u0631\u062c\u0647 \u0633\u0627\u0646\u062a\u06cc\u200c\u06af\u0631\u0627\u062f"},{"title":"\u0627\u0645\u06a9\u0627\u0646 \u062e\u0634\u06a9\u200c\u0634\u0648\u06cc\u06cc","value":"\u0646\u062f\u0627\u0631\u062f"},{"title":"\u0627\u0645\u06a9\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0633\u0641\u06cc\u062f\u06a9\u0646\u0646\u062f\u0647","value":"\u0646\u062f\u0627\u0631\u062f"},{"title":"\u0645\u0646\u0627\u0633\u0628 \u0628\u0631\u0627\u06cc ","value":"\u0622\u0642\u0627\u06cc\u0627\u0646"},{"title":"\u0645\u0646\u0627\u0633\u0628 \u0628\u0631\u0627\u06cc \u0641\u0635\u0648\u0644","value":"\u062a\u0645\u0627\u0645 \u0641\u0635\u0648\u0644"},{"title":"\u0628\u0631\u0646\u062f","value":"Brand Payless"}],"product_size_guide":[["\u0633\u0627\u06cc\u0632","\u0642\u062f","\u062f\u0648\u0631 \u0633\u06cc\u0646\u0647","\u0633\u0631\u0634\u0627\u0646\u0647","\u0622\u0633\u062a\u06cc\u0646"],["S","75","102","44","60"],["M","76","108","45","61"],["L","78","112","47","62"],["XL","80","118","49","63"],["XXL","83","122","51","64"]],"product_category_size_guide":null,"images":{"cart_default":["https:\/\/www.banimode.com\/659063-cart_default\/53620.jpg","https:\/\/www.banimode.com\/603021-cart_default\/53620.jpg","https:\/\/www.banimode.com\/659065-cart_default\/53620.jpg","https:\/\/www.banimode.com\/603022-cart_default\/53620.jpg"],"small_default":["https:\/\/www.banimode.com\/659063-small_default\/53620.jpg","https:\/\/www.banimode.com\/603021-small_default\/53620.jpg","https:\/\/www.banimode.com\/659065-small_default\/53620.jpg","https:\/\/www.banimode.com\/603022-small_default\/53620.jpg"],"medium_default":["https:\/\/www.banimode.com\/659063-medium_default\/53620.jpg","https:\/\/www.banimode.com\/603021-medium_default\/53620.jpg","https:\/\/www.banimode.com\/659065-medium_default\/53620.jpg","https:\/\/www.banimode.com\/603022-medium_default\/53620.jpg"],"home_default":["https:\/\/www.banimode.com\/659063-home_default\/53620.jpg","https:\/\/www.banimode.com\/603021-home_default\/53620.jpg","https:\/\/www.banimode.com\/659065-home_default\/53620.jpg","https:\/\/www.banimode.com\/603022-home_default\/53620.jpg"],"large_default":["https:\/\/www.banimode.com\/659063-large_default\/53620.jpg","https:\/\/www.banimode.com\/603021-large_default\/53620.jpg","https:\/\/www.banimode.com\/659065-large_default\/53620.jpg","https:\/\/www.banimode.com\/603022-large_default\/53620.jpg"],"thickbox_default":["https:\/\/www.banimode.com\/659063-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/603021-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/659065-thickbox_default\/53620.jpg","https:\/\/www.banimode.com\/603022-thickbox_default\/53620.jpg"],"thickbox_default2x":["https:\/\/www.banimode.com\/659063-thickbox_default2x\/53620.jpg","https:\/\/www.banimode.com\/603021-thickbox_default2x\/53620.jpg","https:\/\/www.banimode.com\/659065-thickbox_default2x\/53620.jpg","https:\/\/www.banimode.com\/603022-thickbox_default2x\/53620.jpg"],"zoom":["https:\/\/www.banimode.com\/659063\/53620.jpg","https:\/\/www.banimode.com\/603021\/53620.jpg","https:\/\/www.banimode.com\/659065\/53620.jpg","https:\/\/www.banimode.com\/603022\/53620.jpg"]},"videos":[],"size":[{"name":"S","slug":"S","id_size":6,"position":5,"reference":"00NB218STR1RED00000S","extra_barcodes":[],"id_product_attribute":365875,"active":1,"quantity":5,"specific_price":null},{"name":"M","slug":"M","id_size":7,"position":6,"reference":"00NB218STR1RED00000M","extra_barcodes":[],"id_product_attribute":365874,"active":1,"quantity":5,"specific_price":null},{"name":"L","slug":"L","id_size":5,"position":7,"reference":"00NB218STR1RED00000L","extra_barcodes":[],"id_product_attribute":365873,"active":1,"quantity":5,"specific_price":null},{"name":"XL","slug":"XL","id_size":2,"position":8,"reference":"00NB218STR1RED0000XL","extra_barcodes":[],"id_product_attribute":365872,"active":1,"quantity":0,"specific_price":null},{"name":"XXL","slug":"XXL","id_size":3,"position":9,"reference":"00NB218STR1RED0002XL","extra_barcodes":[],"id_product_attribute":365871,"active":1,"quantity":5,"specific_price":null}],"total_qty":10,"all_colors":[{"id":2021,"value":"#990034","name":"\u0633\u0641\u06cc\u062f \u0632\u0631\u0634\u06a9\u06cc","slug":"\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","image":[{"alt":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","title":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","image_size":{"cart_default":"https:\/\/www.banimode.com\/659063-cart_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","small_default":"https:\/\/www.banimode.com\/659063-small_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","medium_default":"https:\/\/www.banimode.com\/659063-medium_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","home_default":"https:\/\/www.banimode.com\/659063-home_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","large_default":"https:\/\/www.banimode.com\/659063-large_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default":"https:\/\/www.banimode.com\/659063-thickbox_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default2x":"https:\/\/www.banimode.com\/659063-thickbox_default2x\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","zoom":"https:\/\/www.banimode.com\/659063\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg"}},{"alt":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","title":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","image_size":{"cart_default":"https:\/\/www.banimode.com\/603021-cart_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","small_default":"https:\/\/www.banimode.com\/603021-small_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","medium_default":"https:\/\/www.banimode.com\/603021-medium_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","home_default":"https:\/\/www.banimode.com\/603021-home_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","large_default":"https:\/\/www.banimode.com\/603021-large_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default":"https:\/\/www.banimode.com\/603021-thickbox_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default2x":"https:\/\/www.banimode.com\/603021-thickbox_default2x\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","zoom":"https:\/\/www.banimode.com\/603021\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg"}},{"alt":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","title":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","image_size":{"cart_default":"https:\/\/www.banimode.com\/659065-cart_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","small_default":"https:\/\/www.banimode.com\/659065-small_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","medium_default":"https:\/\/www.banimode.com\/659065-medium_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","home_default":"https:\/\/www.banimode.com\/659065-home_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","large_default":"https:\/\/www.banimode.com\/659065-large_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default":"https:\/\/www.banimode.com\/659065-thickbox_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default2x":"https:\/\/www.banimode.com\/659065-thickbox_default2x\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","zoom":"https:\/\/www.banimode.com\/659065\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg"}},{"alt":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","title":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","image_size":{"cart_default":"https:\/\/www.banimode.com\/603022-cart_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","small_default":"https:\/\/www.banimode.com\/603022-small_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","medium_default":"https:\/\/www.banimode.com\/603022-medium_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","home_default":"https:\/\/www.banimode.com\/603022-home_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","large_default":"https:\/\/www.banimode.com\/603022-large_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default":"https:\/\/www.banimode.com\/603022-thickbox_default\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","thickbox_default2x":"https:\/\/www.banimode.com\/603022-thickbox_default2x\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg","zoom":"https:\/\/www.banimode.com\/603022\/\u0633\u0641\u06cc\u062f-\u0632\u0631\u0634\u06a9\u06cc.jpg"}}]}],"all_colors_pwa":[{"value":"#990034","name":"\u0633\u0641\u06cc\u062f \u0632\u0631\u0634\u06a9\u06cc","slug":"\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc"}],"promotion_label":null,"available_notify":true,"body_type":"upperbody","size_chart_support":true,"new_size_chart_support":true,"cash_back":null,"customer_club_coin":19,"from":null,"to":null};
var productID = 53620;
var productImgSrc = '';
var quickView = false;
var roundMode = 2;
var static_token = '83e672e3da665d03f05af37e983192cb';
var token = '83e672e3da665d03f05af37e983192cb';
var tplUri = '/themes/new/';
var usingSecureMode = true;
'''

I use this regex to extract var product

regex="^var\sproduct\s=.*;"
product = re.findall(regex,string)

but it return an empty list([])

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

what should i do?

>Solution :

You should run your regex in multiline mode:

product = re.findall(r'^var\s+product\s*=\s*(.*);', string, flags=re.M)
print(product[0])

This prints:

‘{"product_price":199000,"product_specific_price":null,"in_flash_sales":false,"product_name":"\u067e\u06cc\u0631\u0627\u0647\u0646 \u0645\u0631\u062f\u0627\u0646\u0647 \u0631\u0627\u0647 \u0631\u0627\u0647 \u0628\u0631\u0646\u062f \u067e\u06cc \u0644\u0633 Brand Payless \u06a9\u062f B218","product_manufacturer_name":"Brand Payless","product_category_size_guide":null,"colors":[{"id_product_attribute":365871,"has_product_set":0,"product_sets":[],"link":"BM-53620/\u067e\u06cc\u0631\u0627\u0647\u0646-\u0645\u0631\u062f\u0627\u0646\u0647-\u0631\u0627\u0647-\u0631\u0627\u0647-\u0628\u0631\u0646\u062f-\u067e\u06cc-\u0644\u0633-brand-payless-\u06a9\u062f-b218.html#/\u0631\u0646\u06af-\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","color_name":"\u0633\u0641\u06cc\u062f \u0632\u0631\u0634\u06a9\u06cc","id_color":2021,"color_slug":"\u0633\u0641\u06cc\u062f_\u0632\u0631\u0634\u06a9\u06cc","quantity":10,"color_value":"#990034","zoom":["https://www.banimode.com/659063/53620.jpg&quot;,"https://www.banimode.com/603021/53620.jpg&quot;,"https://www.banimode.com/659065/53620.jpg&quot;,"https://www.banimode.com/603022/53620.jpg"%5D,"values&quot;:["https://www.banimode.com/659063-thickbox_default/53620.jpg&quot;,"https://www.banimode.com/603021-thickbox_default/53620.jpg&quot;,"https://www.banimode.com/659065-thickbox_default/53620.jpg&quot;,"https://www.banimode.com/603022-thickbox_default/53620.jpg"%5D,"size&quot;:[{"name":"S","quantity":5,"id_product_attribute":365875,"reference":"00NB218STR1RED00000S"},{"name":"M","quantity":5,"id_product_attribute":365874,"reference":"00NB218STR1RED00000M"},{"name":"L","quantity":5,"id_product_attribute":365873,"reference":"00NB218STR1RED00000L"},{"name":"XL","quantity":0,"id_product_attribute":365872,"reference":"00NB218STR1RED0000XL"},{"name":"XXL","quantity":5,"id_product_attribute":365871,"reference":"00NB218STR1RED0002XL"}],"videos":[],"new_size_chart_support":true,"id_product":53620}]}’

The problem with your current approach is that, absent multiline mode, the ^ anchor refers to the start of the entire input, not the start of the product line.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading