This should do that: \define myregexp() ^([a-zA-Z]+\.){2}[a-zA-Z]+$ <<list-links "[regexp<myregexp>]">>
In this example, I'm using groups and a quantifier, since the first match gets repeated twice. You can expand that out if it's easier to scan. -- Mark On Saturday, July 14, 2018 at 7:31:52 PM UTC-7, TonyM wrote: > > Josiah, > > I am glad for your help, and marks - I need to jump into regex soon, but > it seems to require a lot of rote learning - perhaps I can make a wiki for > that? > > In the case in question the three words can only be a-zA-Z > > What would I replace \w with for this outcome? > > Thank > Tony > > On Sunday, July 15, 2018 at 10:40:20 AM UTC+10, @TiddlyTweeter wrote: >> >> Ciao TonyM & Mark S. >> >> Really interesting work. >> >> A few small non-consequential notes on the regex ... This is just for >> interest. >> >> Marks' ... >> >> ^\w+?\.\w+?\.\w+?$ >> >> is perfectly serviceable. But it will work simpler too ... >> >> ^\w+\.\w+\.\w+$ >> >> ... The qualifying "?" that is to prevent "greedy" matches is not needed. >> A greedy match here is fine. >> >> One issue is that \w is shorthand for the JS character class ... >> >> [a-zA-Z0-9_] >> >> This means IF you used, for instance, any accented character it would >> break. >> >> A way round this would be to add the accented characters to an explicit >> class. But every one would need explicitly adding. Easier would be to use , >> instead of \w, a negative character class like [^\.] = its not a full-stop. >> >> The only problem with regex character classes in TW is they get a bit >> baroque to use as they need square brackets so you can't do them directly >> -- https://tiddlywiki.com/#regexp%20Operator >> >> Just thoughts >> > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/25eabcb6-90a4-4aa1-9e72-494f211e55ec%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.