+ Reply to Thread
Results 1 to 3 of 3

Extract matches of all the groups within regex pattern

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Extract matches of all the groups within regex pattern

    Hello everyone

    As starting point, I am seeking for this approach of using regex so please don't post any other approaches as I am already have different working alternatives but my target is to learn this specific point (which is to extract the groups within the regex pattern)

    To make everything is clear, here's HTML page on the following link
    https://pastebin.com/nu0dLvch
    Copy the contents and paste into text file and save as Sample.html on the drive C:\

    And use selenium in VBA to run the following code
    Please Login or Register  to view this content.
    The code opens the Sample.html and with a pattern extracts block of data .. Then I used SPLIT function to split the five parts of each block ..
    The code works fine and the results as expected exactly

    What I am seeking to learn a new skill which is to group the five parts using the pattern itself then extract the five parts(groups) to a row and so on
    With the help of experts at regex, I got the following pattern that do the task of grouping
    https://regex101.com/r/AUBup2/2
    And this is the pattern
    Please Login or Register  to view this content.
    What I need to learn (TO LEARN) >> to learn how to extract the groups from a pattern ..

    Here's snapshot of the final output
    Untitled.png

    Thanks advanced for help

    ** Posted here too
    http://www.eileenslounge.com/viewtopic.php?f=30&t=34784
    Last edited by YasserKhalil; 06-16-2020 at 04:38 PM.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Re: Extract matches of all the groups within regex pattern

    I could figure out after three hours
    Thanks a lot
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Re: Extract matches of all the groups within regex pattern

    Added a link to the html
    http://try.jsoup.org/~ykvVbJjzQwfNpwCo4BAeiKhwlL0

    And here's the regex pattern link with the results (the table is of five columns)
    https://regex101.com/r/yHlvVS/1
    and here's the pattern used
    Please Login or Register  to view this content.
    The idea of using the regex is to identify each block of data and then it would be easier to extract the data.
    Last edited by YasserKhalil; 04-10-2021 at 10:40 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Extract specific group in regex pattern
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2020, 01:57 PM
  2. [SOLVED] Regex Pattern Matching
    By visualnotsobasic in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2018, 09:56 PM
  3. [SOLVED] Pattern for regex that matches one digit at least
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-10-2018, 01:57 AM
  4. RegEx - Pattern Matching
    By paularthur90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2017, 09:16 AM
  5. RegEx pattern
    By capson in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 02-15-2015, 06:57 PM
  6. Regex - establishing a pattern
    By twckfa16 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-30-2014, 11:06 AM
  7. [SOLVED] RegEx pattern to extract multiplelines title in TXT file
    By p24leclerc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2014, 08:39 PM

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