Thread: Regex examples
View Single Post
Old 03-19-2025, 06:23 PM   #779
Pavulon
Member
Pavulon began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Aug 2023
Device: Kobo Forma
Good evening Haudek,

Perfect, it works very well.
I understand the regex you gave me:
- a non-capturing group
- the secure management of spaces (\s+).
- 1 or more characters (\w+) up to the = sign
- between quotation marks, a set (from 0 to several) of characters, except for a quotation mark
- the non-capturing group, present from 0 to several times

but I'd never have thought of something like that. What's more, the quantifier “?” (0 or 1) works with it!

Would you have an explanation, not too learned for me, as to why the formula (.*?)? only works when the chain is present, whereas the quantifier says (0 or 1)?

I've made a note of how to do this for images and HTML entities, for another time.

Thank you very much.
Pavulon is offline   Reply With Quote