+ Reply to Thread
Results 1 to 7 of 7

RegEx to parse string

  1. #1
    Registered User
    Join Date
    07-03-2006
    Posts
    74

    RegEx to parse string

    Hi everyone,

    been looking for a solution for about a week, but apparently RegEx can be used in about 54,658 different ways, and none of the stuff I found was clear enough (or easy enough ) to understand. I hope someone here can help...

    I have a file which contains 15,000 of the following (for those interested: it's the data file for the Auctioneer add-on of WoW):

    {\"|cffffffff|Hitem:23425:0:0:0:0:0:0:1624370944:80:0|h[Adamantite Ore]|h|r\",65,\"Trade Goods\",\"Metal & Stone\",nil,67919,3,1314985659,\"Adamantite Ore\",\"Interface\\\\Icons\\\\INV_Ore_Adamantium\",1,1,1,1,67919,0,76466,0,false,\"Infernuus\",0,8916,23425,0,0,0,1624370944,}

    I would need to decompose it to (but in columns):

    cffffffff
    Hitem:23425:0:0:0:0:0:0:1624370944:80:0
    Adamantite Ore
    65
    Trade Goods
    Metal & Stone
    nil
    67919
    3
    1314985659
    Adamantite ore
    Interface\\\\Icons\\\\INV_Ore_Adamantium
    1
    1
    1
    1
    67919
    0
    76466
    0
    false
    Infernuus
    0
    8916
    23425
    0
    0
    0
    1624370944

    Could someone please give me some clear advise on how to implement this in VBA?

    Thanks a bunch for any feedback!
    "Colors fade, but dumb is forever" - Sally Solomon

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: RegEx to parse string

    Please Login or Register  to view this content.
    etc.
    Last edited by snb; 09-03-2011 at 02:59 PM.



  3. #3
    Registered User
    Join Date
    07-03-2006
    Posts
    74

    Re: RegEx to parse string

    Quote Originally Posted by snb View Post
    Please Login or Register  to view this content.
    etc.
    Thanks for the reply, but I think I wasn't clear enough. The 15,000 items are constructed the same as the example, but contain different data (so it's not all "Adamantite Ore", or "Trade Goods"). That's why I need some pointers on RegEx and patterns (and a way to run this in VBA).

    Sorry for the confusion!
    Last edited by opopanax666; 09-04-2011 at 02:17 PM.

  4. #4
    Registered User
    Join Date
    07-03-2006
    Posts
    74

    Re: RegEx to parse string

    whispers: ...bump...

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: RegEx to parse string

    Please read my post again and try to grasp the code.
    It isn't meant for one string only.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,308

    Re: RegEx to parse string

    Does it even compile?
    Anyone who confuses correlation and causation ends up dead.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: RegEx to parse string

    snb,

    Your signature blatenly states, avoid using code you don't understand.. .yet you post code very few understand.

    What does:
    It isn't meant for one string only.
    mean?

    please have the decency to explain the code, rather than throw one-liners and then tell users who are trying to implement the code to "try to grasp the code".
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1