On Tuesday, June 30, 2020 at 8:07:06 PM UTC-7, Mark S. wrote:
>
> If we had a regular expression splitter (e.g. PR2963), then you could trim
> out prefix, suffix, or even create multiple splits from one input string.
> This would save having to create multiple filters for manipulating strings,
> especially since any new string operators would have names very similar to
> existing operators.
>
Even though this commit hasn't been accepted into the TWCore, I've been
using it since 2017 on a private project.
In that project, I have tiddlers whose title contains a 14-digit date/time
stamp like this:
$:/Category/Section/20200616071922/Name/Of/Item/Here
where "$:/Category/Section" can vary (e.g., "$:/Books/SciFi",
"$:/Music/Rock", "$:/Photos/Vacation", etc.)
and the date/time stamp shows when that tiddler was added to my collection
of stuff,
regardless of when the TWCore recorded that tiddler as *created* or
*modified*
and I use the regexps[] filter operator like this:
\define itempattern() [0-9]{14}$
\define datepattern() ^[0-9]{8}
\define getAllDates() [prefix<categorysection>regexps<itempattern>regexps
<datepattern>!sort[]]
This lets me create a list of items in a selected "categorysection", sorted
by the date/time stamps contained in the titles
Although I'd like to see this particular PR (
https://github.com/Jermolene/TiddlyWiki5/pull/2963) accepted into the core,
it seems that Jeremy isn't quite satisfied as to "whether this is the best
we can do for the core". He has suggested
that "this PR being made into a plugin, which is the best place for
experimentation."
So, the follow up is: can we get this into the "Official TiddlyWiki Plugin
Library"?
That would enable people who need this functionality to move forward, but
also allow continued investigation
and exploration of alternative solutions for the TWCore. If, at some
future date, this solution is superseded by
a different core solution, it can be retired from the Plugin Library in
favor of that new core solution.
In the meantime, the regexps[] filter can be installed manually by copying
the code from here:
https://github.com/Marxsal/TiddlyWiki5/blob/regular_expression_strings/core/modules/filters/regexps.js
and creating a tiddler with field module-type = "filteroperator"
-e
--
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/b251e04a-7acc-474e-ab31-4464d8e3e8abo%40googlegroups.com.