1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[VB .NET] Question regarding parsing..I'm stuck. =\

Discussion in 'Visual Basic .NET' started by Xecurity., Dec 6, 2012.

  1. Xecurity.

    Xecurity. Newbie

    Joined:
    Dec 5, 2012
    Messages:
    2
    Likes Received:
    0
    Ok, so to make a long story short I'm making an automator/bot for Mocospace(yes, i know its broken o down but ive gotten excellent results.) Anyways, Ive gotten everything down from comments, messages, and all but I can't seem to get the parsing of the usernames down. The HTML isn't complicated at all, I'm just not too familiar with RegEx and/or VisualBasic.Left,Mid,Right, etc. So could someone please assist me in this problem. Once that program is in beta stage, i'll be more than happy to release a pre-beta as well.


    Ok so, heres what I'm trying to do..

    Possible parse #1:
    HTML:
    <strong> <a href="/manofgod78">manofgod78</a> </strong> <div class="asl" style="float: right"> 34 M </div> </div> <div class="asl" style="padding-top: 5px">
    
    **"manofgod78" is what I'm trying to parse and have added to listbox.**

    I appreciate all the help, in advance.

    -Xecurity.
     
  2. captchaman

    captchaman Junior Member

    Joined:
    Sep 16, 2010
    Messages:
    190
    Likes Received:
    842
    Occupation:
    Software Programmer
    Location:
    USA
    Might not be the best way (because it's not regex) but you can use Getbetween to get one item, or GetBetweenAll to get multiple items and add them to a listbox.

     
  3. Xecurity.

    Xecurity. Newbie

    Joined:
    Dec 5, 2012
    Messages:
    2
    Likes Received:
    0
    Oh sweet! Thanks a million bro, I had the GetBetween but not the GBA. I appreciate it.
     
  4. andee

    andee Regular Member

    Joined:
    Jul 24, 2010
    Messages:
    218
    Likes Received:
    83
    did you get it too work ? i could make up a (messy) regex or even split will work. Try and use array's as well ie arraylist , i know it looks cool when the list box fills up with items ( well from my own experience lol), but its sooo much faster and efficient using arrays (and others) not to mention you can multithread items from them, not like list box's
     
  5. JKasper

    JKasper Newbie

    Joined:
    Feb 21, 2012
    Messages:
    4
    Likes Received:
    5
    Here is a regex that will do it:

    Code:
    <strong>\s*<a href=\"\/(.+?)\">(.+?)</a>\s*</strong>