Click here to Skip to main content
15,563,763 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
GeneralRe: Regex to match exact word and dash symbol Pin
Member 1533502225-Aug-21 1:24
Member 1533502225-Aug-21 1:24 
GeneralRe: Regex to match exact word and dash symbol Pin
User 1521787325-Aug-21 2:11
User 1521787325-Aug-21 2:11 
QuestionProblem capturing last group in a line: CLOSED Pin
mo149222-Aug-21 14:18
mo149222-Aug-21 14:18 
AnswerRe: Problem capturing last group in a line: CLOSED Pin
Richard Deeming22-Aug-21 22:46
mveRichard Deeming22-Aug-21 22:46 
GeneralRe: Problem capturing last group in a line: CLOSED Pin
mo149223-Aug-21 7:17
mo149223-Aug-21 7:17 
QuestionEmployer Identification Number (EIN) Regex Pin
Member 153111493-Aug-21 10:49
Member 153111493-Aug-21 10:49 
AnswerRe: Employer Identification Number (EIN) Regex Pin
User 1521787322-Aug-21 3:40
User 1521787322-Aug-21 3:40 
QuestionRegex select from list Pin
Jukec30-Jun-21 13:33
Jukec30-Jun-21 13:33 
Hello,

I am trying to learn Regex on my own, but got stuck with select from an unordered list.
At this moment i managed to list the cattegories, but i cant figure how to
1) capture the node ID for each cattegory (for example 560884 for the first one)
2) how to define ">" not to be listed as cattegory.

Here is my code:
select div#wayfinding-breadcrumbs_feature_div li >>> category_tree {
  select span.a-list-item >> category_name;
  select div#wayfinding-breadcrumbs_container .a-link-normal >> attr(href) >> capture "[node=\\d+]" >> node_id;
}


Here is part of the output:
"category_tree": [{
    "category_name": "Portable Sound & Video",
    "node_id": null
  }, {
    "category_name": "›",
    "node_id": null
  }, {
    "category_name": "Accessories",
    "node_id": null

Here is source code:
HTML
<pre><div id="wayfinding-breadcrumbs_feature_div" class="a-subheader a-breadcrumb feature" data-feature-name="wayfinding-breadcrumbs" data-cel-widget="wayfinding-breadcrumbs_feature_div">
    <ul class="a-unordered-list a-horizontal a-size-small">
         <li>
            <a class="a-link-normal a-color-tertiary" href="/mp3-ipod-headphones-DAB-radio/b/ref=dp_bc_aui_C_1?ie=UTF8&node=560884">
                Portable Sound & Video
            </a>
         </li>
         <li class="a-breadcrumb-divider"></li>
         <li>
            <a class="a-link-normal a-color-tertiary" href="/Accessories-Portable-Sound-Vision-Tapes/b/ref=dp_bc_aui_C_2?ie=UTF8&node=560910">
                Accessories
            </a>
         </li>
         <li class="a-breadcrumb-divider"></li>
         <li>
             <a class="a-link-normal a-color-tertiary" href="/b/ref=dp_bc_aui_C_3?ie=UTF8&node=16700222031">
                 Portable Speakers & Docks
             </a>
         </li>
    </ul>
</div>


Thank you for your help
AnswerRe: Regex select from list Pin
jschell8-Aug-21 9:27
jschell8-Aug-21 9:27 
QuestionNeed some help with regular expression Pin
Member 1524909515-Jun-21 19:22
Member 1524909515-Jun-21 19:22 
AnswerRe: Need some help with regular expression Pin
Member 1524502415-Jun-21 21:05
Member 1524502415-Jun-21 21:05 
GeneralRe: Need some help with regular expression Pin
Member 1524909515-Jun-21 21:24
Member 1524909515-Jun-21 21:24 
GeneralRe: Need some help with regular expression Pin
Member 1524502415-Jun-21 23:43
Member 1524502415-Jun-21 23:43 
AnswerRe: Need some help with regular expression Pin
Richard MacCutchan15-Jun-21 23:25
mveRichard MacCutchan15-Jun-21 23:25 
GeneralRe: Need some help with regular expression Pin
Member 1524502415-Jun-21 23:48
Member 1524502415-Jun-21 23:48 
GeneralRe: Need some help with regular expression Pin
Richard MacCutchan16-Jun-21 0:00
mveRichard MacCutchan16-Jun-21 0:00 
GeneralRe: Need some help with regular expression Pin
Member 1524502416-Jun-21 9:53
Member 1524502416-Jun-21 9:53 
GeneralRe: Need some help with regular expression Pin
Richard MacCutchan16-Jun-21 11:10
mveRichard MacCutchan16-Jun-21 11:10 
AnswerRe: Need some help with regular expression Pin
User 1521787319-Jun-21 14:07
User 1521787319-Jun-21 14:07 
QuestionInterrupted list Pin
Member 1524502413-Jun-21 23:52
Member 1524502413-Jun-21 23:52 
AnswerRe: Interrupted list Pin
OriginalGriff13-Jun-21 22:58
mvaOriginalGriff13-Jun-21 22:58 
GeneralRe: Interrupted list Pin
Member 1524502414-Jun-21 0:25
Member 1524502414-Jun-21 0:25 
GeneralRe: Interrupted list Pin
OriginalGriff14-Jun-21 2:53
mvaOriginalGriff14-Jun-21 2:53 
AnswerRe: Interrupted list Pin
User 1521787319-Jun-21 16:36
User 1521787319-Jun-21 16:36 
QuestionMatching exact string with a vertical bar and square brackets Pin
RanCohen31-May-21 4:02
RanCohen31-May-21 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.