faustf Posted September 23, 2016 Share Posted September 23, 2016 hi guys i have a text like this expandcollapse popupGetCategoryFeaturesResponse xmlns="urn:ebay:apis:eBLBaseComponents" <Timestamp>2016-09-23T10:06:35.321Z Ack Success Version 969 Build E969_INTL_APICATALOG_17991264_R1 CategoryVersion 1014 UpdateTime 2016-09-23T09:45:35.000Z Category <CategoryID>63867 ListingDuration type="Chinese" 1 ListingDuration type="Dutch" 1 ListingDuration type="Live" 1 ListingDuration type="AdType" 2 ListingDuration type="StoresFixedPrice" 31 ListingDuration type="PersonalOffer" 1 ListingDuration type="FixedPriceItem" 8 ListingDuration type="LeadGeneration" 19 /Category <SiteDefaults><ListingDuration type="Chinese">1 ListingDuration type="Dutch" 1 ListingDuration type="Live" 1 ListingDuration type="AdType" 2 ListingDuration type="StoresFixedPrice" 31 ListingDuration type="PersonalOffer" 1 ListingDuration type="FixedPriceItem" 8 ListingDuration type="LeadGeneration" 19 /SiteDefaults <FeatureDefinitions><ListingDurations Version="9"><ListingDuration durationSetID="1"><Duration>Days_3 Duration Days_5 Duration Days_7 Duration Days_10 /ListingDuration <ListingDuration durationSetID="2"><Duration>Days_30 Duration Days_90 /ListingDuration <ListingDuration durationSetID="19"><Duration>Days_28 /ListingDuration <ListingDuration durationSetID="8"><Duration>Days_3 Duration Days_5 Duration Days_7 Duration Days_10 Duration Days_30 /ListingDuration <ListingDuration durationSetID="31"><Duration>Days_3 Duration Days_5 Duration Days_7 Duration Days_10 Duration Days_30 Duration GTC /ListingDuration /FeatureDefinitions i want take for example StoresFixedPrice and number after 31 i write a regexp like this (?i)ListingDuration type="(.*?)"\n(.*?)\n but not work also if in regexbuddy work where i do mistake?? Link to comment Share on other sites More sharing options...
coffeeturtle Posted September 23, 2016 Share Posted September 23, 2016 (edited) *deleted* Edited September 23, 2016 by coffeeturtle deletion Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted September 23, 2016 Share Posted September 23, 2016 (edited) I though I understood what you wanted, but then read it again and think I got it wrong. I think your regex is good, but your autoit code is wrong, can you post your code? Edited September 23, 2016 by ViciousXUSMC Link to comment Share on other sites More sharing options...
faustf Posted September 23, 2016 Author Share Posted September 23, 2016 Func _publish_day_listing($sCategory) $aCat_numb = StringRegExp($sCategory, "[\d]*", $STR_REGEXPARRAYGLOBALMATCH) Local $aCat_numb_clean = _Remove_BlankIN_Array($aCat_numb) If IsArray($aCat_numb_clean) Then Local $xLXML_dirty = _eBay_GetCategoryFeatures_RSFS($aCat_numb_clean[UBound($aCat_numb_clean) - 1]) _ArrayDisplay($xLXML_dirty) Local $xLXML_dirty_bidTAKE= _ArrayToString($xLXML_dirty) ; Local $sLTypeBid= StringRegExp ($xLXML_dirty_bidTAKE,'(?i)ListingDuration type="(.*?)"',$STR_REGEXPARRAYGLOBALMATCH) Local $sLTypeBid= StringRegExp ($xLXML_dirty_bidTAKE,'(?i)type=[\"\"]\w.*\r\n\d*',1);$STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($sLTypeBid) #cs For $i=0 To UBound($sLTypeBid) - 1 Local $iIndex = _ArraySearch($sLTypeBid, $sLTypeBid[$i]) ;_ArrayDelete($sLTypeBid, $iIndex) MsgBox(0,'',$iIndex) Next #ce EndIf EndFunc ;==>_publish_day_listing Link to comment Share on other sites More sharing options...
faustf Posted September 23, 2016 Author Share Posted September 23, 2016 i understund me i change the array when do _arraytostring _arraydisplay.... it deceived me thankz at all Link to comment Share on other sites More sharing options...
kylomas Posted September 23, 2016 Share Posted September 23, 2016 faustf, suggestion... #include <array.au3> local $aRET = stringregexp(fileread(@scriptdir & '\test.txt'),'(?ims)listingduration.*?(\d+)',3) _arraydisplay($aRET) file = test.txt Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jguinch Posted September 23, 2016 Share Posted September 23, 2016 another one : StringRegExp($content, "type="StoresFixedPrice"\s*(\d+)", 1) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now