09-30-2022, 09:21 AM | #1 |
Connoisseur
Posts: 57
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Regex question
Hi,
I posted a thread a while ago and cannot find it If this a duplicate I apologize. I have been getting started with regex expressions using a tutorial I found on these forums. Finding number sequences work fine. Number and alpha give me a problem. Trying to get a match for: <body class="content" id="uiW9njI8qPGOt6Hp7wdrNu5"> with variable alpha and numerics. Tried <body class="content" id="[a-z][A-Z][0-9]"> <body class="content" id="[a-zA-Z0-9]"> <body class="content" id="\w"> None of witch found a match. What am I missing? Thanks Phil |
09-30-2022, 09:56 AM | #2 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
A '+' sign.
In Regex, + means "ONE OR MORE of the previous thing".
Or:
You also have other symbols/methods too:
- - - Side Note: I'd highly recommend looking at some of my step-by-step breakdowns of regex over the years... Here's a few of them:
I explain what each piece does, and many times, I even color-coordinate everything with colors to make it easier to understand which piece does what. You may also want to type this into your favorite search engine: Code:
Tex2002ans regular expressions site:mobileread.com Tex2002ans regular expressions site:reddit.com Last edited by Tex2002ans; 09-30-2022 at 10:06 AM. |
Advert | |
|
09-30-2022, 10:21 AM | #3 | ||
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
Code:
<body.+?> Code:
<body class=.+? id=.+?> Code:
<body class="content" id=.+?> https://regex101.com/ Quote:
Last edited by enuddleyarbl; 09-30-2022 at 10:37 AM. |
||
09-30-2022, 10:44 AM | #4 |
Connoisseur
Posts: 57
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
|
09-30-2022, 10:48 AM | #5 |
Connoisseur
Posts: 57
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pdf regex question - regex that wraps to a new line | flyash | Conversion | 1 | 09-05-2021 09:00 AM |
Regex question | rolgiati | Calibre | 2 | 11-26-2017 01:58 PM |
Yet another regex question | Jabby | Sigil | 8 | 01-30-2012 08:41 PM |
Regex question and maybe some help | crutledge | Sigil | 9 | 03-10-2011 04:37 PM |
Regex Question | Archon | Conversion | 11 | 02-05-2011 10:13 AM |