php - regex to get everything between apostrophes but do not return apostrophes -


i using following code grab challenge

preg_match("/'03ahj(.*?)'/", $recaptcha_page_response,$captchastring); 

on following text

var recaptchastate = {     challenge : '03ahj_vuvttaeouhgwbbxlqxnyrpyagvrs5lff2n90asrwhio3payqd6lfnhnwb_cvexafwhcgtk5zmhpetpy2nawxfodlcxuub3v2guaa7ezdn0vqa6chewwif8yfbm3i7zn0xtkzhkitsxfcarzgmh4arft-owzsrogpam_og0hp12czmgwmv15fwcnctfuypkxnphdv8fagw4ydinvxal8nhxijeen6m4ibjx4kgcjolyqimbzj54i7jfzas9omlk-giv3coq7ahutgjeg9f9joya4wkxxksg',     timeout : 1800,     lang : 'en',     server : 'http://www.google.com/recaptcha/api/',     site : '6lec3o0saaaaac_ycszkqches7yidmtp_h-6uttx',     error_message : '',     programming_error : '', 

however returns ' in array[0] becomes

$captchastring = "http://www.google.com/recaptcha/api/image?c=$captchastring[0]"; 

this

http://www.google.com/recaptcha/api/image?c='03ahj_vutyynskzgrlzb3czhaotgfl2jgc-r0s5fvxz9oelzqn-cbgtfqbzo0m-zyfrcxdxw9nowvvcz2hszqby-fbngczw4q1zgmlomxgugvlylc49godwissde0ukz904r-5qdc9vybx6asmrufaonrgcfykzumgwkvtg1zgjy5n-dqjldw_xoewr94flxkic-yg_9ca34fjnlz06ol2fsyq9detzqsayq' 

which wrong, regex between '' not include them in returned array?

preg_match("/(?<=')03ahj[^']*/", $recaptcha_page_response,$captchastring); 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -