Hi Tony

There's an old trope in software that one should never use regexps to parse 
HTML:

https://blog.codinghorror.com/parsing-html-the-cthulhu-way/

So, while I'd be happy to see general regexp support improved in TW5, I don't 
think it's appropriate to specifically shape that support for the task of 
parsing HTML.

Of course, TW5 already includes an HTML parser so perhaps the best approach 
might be to explore how to make that functionality be more usefully exposed to 
wikitext.

Best wishes

Jeremy

--
Jeremy Ruston
[email protected]
https://jermolene.com

> On 22 Aug 2019, at 01:37, TonyM <[email protected]> wrote:
> 
> 
> Folks,
> 
> I have a great use case for some advanced regex. I would like to provide a 
> macro with a tiddlername (default Current Tiddler) and field (default text) 
> and a html tag eg `<table>, <tr>, <td> <section>, <article> <div> etc.. as 
> documented here https://www.w3schools.com/html/html_blocks.asp
> 
> I would like a regex to search the target(s) for the html pairs eg `<li>A 
> List items</li>` or `<li style etc>A List items</li>` and and return result 
> optionaly with the html tags still present or only the content between them.
> 
> Perhaps later we could enhance this to interrogate id's and other tag info eg 
> `<div id=nnnn> `
> 
> I think this could be implemented in a subfilter eg
> \define html-tags() regex filter
> <$set name=html-tag value="article">
> <$list filter="[[tiddlername]subfilter<html-tags>]">
> 
> </$list>
> </$set>
> 
> See here https://groups.google.com/d/msg/tiddlywiki/s9Y_w85282I/6na45l5KAAAJ
> 
> Regards
> Tony
> 
> 
> 
>> On Friday, August 16, 2019 at 1:56:24 AM UTC+10, Mohammad wrote:
>> As Tiddlywiki supports regexp and this feature is quite powerful, yet many 
>> of us (like me) has no or little information about it, I would like to 
>> introduce
>> this small resource for easy and quick learning regexp.
>> 
>> https://github.com/ziishaned/learn-regex
>> 
>> 
>> Sometimes ago Tiddly Twitter had a discussion to give examples of using 
>> regexp in TW, but seems he is very busy with Polly!
>> 
>> 
>> By the way if someone can create a wiki in GitHub or tiddlyspot with 
>> practical examples of using regexp, it would be quite useful.
>> 
>> 
>> Cheers
>> Mohammad
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/43b26b25-3d08-4c7f-9ef4-ea4daacfd50e%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0C9D2162-7B36-4CB5-B569-550327F50537%40gmail.com.

Reply via email to