✅ Need help with regular expression pattern
I am trying to match everything between two given tags using regular expression. For example:
9 Replies
sometimes there are better tools for the job... https://discord.com/channels/143867839282020352/251386218351165441/1358654493784543353
leowest
REPL Result: Success
Console Output
Quoted by
<@1102729783969861782> from #bot-spam (click here)
Compile: 1124.924ms | Execution: 50.575ms | React with ❌ to remove this embed.
Thank you. This is so much better for parsing html type documents.
I was learning regular expressions but I'll not use it if I have more readable options like this.
its good to learn regex, but sometimes u find tools that have been tested and just work nice enough for the needs
leowest
REPL Result: Success
Console Output
Compile: 396.277ms | Execution: 92.956ms | React with ❌ to remove this embed.
you can use the captured groups with regex
things get complex when you have multiple levels of tags within each other and malformed html
$htmlregex
Stack Overflow
RegEx match open tags except XHTML self-contained tags
I need to match all of these opening tags:
<p>
<a href="foo">
But not self-closing tags:
<br />
<hr class="foo" />
I came up with this and wanted to make
Thanks, making named groups was increasing complexity unnecessarily
Um.. neither. I was just practicing regex with html type tags.
Don't know much about html or xml. Will look into it when doing something serious.
xml has its own tools to process it as well