Jump to content
faustf

StringRegExp help

Recommended Posts

faustf

hi guys  i have  a text  like this

GetCategoryFeaturesResponse 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??

 

 

Share this post


Link to post
Share on other sites
coffeeturtle

*deleted*

Edited by coffeeturtle
deletion

Share this post


Link to post
Share on other sites
ViciousXUSMC

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 by ViciousXUSMC

Share this post


Link to post
Share on other sites
faustf
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

 

Share this post


Link to post
Share on other sites
faustf

i understund  me  i  change  the array when  do _arraytostring

_arraydisplay....   it deceived me  thankz  at  all :)

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.