[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread Mohammad
Very good code!
I used this with modification to list all .png tiddlers 

*Mohammad*

On Sunday, July 15, 2018 at 7:22:55 AM UTC+4:30, Mark S. wrote:
>
> This should do that:
>
> \define myregexp() ^([a-zA-Z]+\.){2}[a-zA-Z]+$
> <]">>
>
> 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/aa601f67-5868-4d1f-a5c7-b1c874d6e02a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread 'Mark S.' via TiddlyWiki
This should do that:

\define myregexp() ^([a-zA-Z]+\.){2}[a-zA-Z]+$
<]">>

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.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread TonyM
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/19cb0297-a7f5-47e1-af61-61378a7885fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread @TiddlyTweeter
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/3e816e4c-0dcc-4b93-8ed9-1422a0326c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread 'Mark S.' via TiddlyWiki
Application level validation. It will be interesting to see how that works 
out.

-- Mark

On Saturday, July 14, 2018 at 12:54:13 AM UTC-7, TonyM wrote:
>
> Mark,
>
> This actually seems to work really well. I always like to return the 
> favour so perhaps you will find this interesting and its implications.
>
> Place the following in a tiddler tagged $:/tags/ViewTemplate
> \define myregexp() ^\w+?\.\w+?\.\w+?$
> <$list filter="[titleis[missing]]" variable=
> "missingTiddler">
> <$list filter="[{!!title}regexp]">
> Tiddler is missing and in w3w format
> 
> 
> <$list filter="[title!is[missing]]" variable="null">
> <$list filter="[{!!title}regexp]">
> Tiddler is in w3w format
> 
> 
>
> Now if a tiddler has a title of the form word.word.word the above will 
> display according to if it exists or not.
>
> Why is this so interesting?
> If someone comes to my online wiki using a link such 
> as mywiki.html#test.w3w.example
> they will open the tiddler mywiki.html#test.w3w.example if it exists
> if it does not exist they will presented with the missing tiddler, which I 
> can code to have a button appear on it, to help the user create the tiddler.
>
> This provides a way to guide a user into creating a tiddler that does not 
> exist by a title they provide, that meets a naming standard. It could be 
> firstname.surname
>
> Regards
> Tony
>
>
> On Saturday, July 14, 2018 at 3:43:00 PM UTC+10, Mark S. wrote:
>>
>> TT is the real expert, but this may get you started:
>>
>> \define myregexp() ^\w+?\.\w+?\.\w+?$
>> <]">>
>>
>> Regexp is SOOO slippery.Without knowing more about your data, and your 
>> exact requirements, it's hard to know if this nails it. But you can test 
>> and tweak it and see what happens.
>>
>> If you ever need to extract strings, then you will need something similar 
>> to the solution in PR 2963.
>>
>> -- Mark
>>
>> On Friday, July 13, 2018 at 8:45:41 PM UTC-7, TonyM wrote:
>>>
>>> Folks,
>>>
>>> I have some tiddlers titled in the form name1.name2.name3
>>>
>>> I would like to test any tiddler title to test it is of this form, but 
>>> not sure how to do so, even after some research
>>>
>>> Basically is it three words separated by "." periods
>>> We can assume no other delimiters will be found such as spaces or [[ {{ 
>>> etc..
>>>
>>> I imagine a regex expression can do It, but I have not yet undergone 
>>> this self education
>>>
>>> I want to simply determine if it is true or not and reveal/listWidget 
>>> some wiki text, 
>>>
>>> however one day I may want to extract the three words.
>>>
>>> Thanks in advance
>>> Tony
>>>
>>

-- 
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/6ad33cd7-c20b-4ea6-ac3e-755503564afa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread TonyM
Mark,

This actually seems to work really well. I always like to return the favour 
so perhaps you will find this interesting and its implications.

Place the following in a tiddler tagged $:/tags/ViewTemplate
\define myregexp() ^\w+?\.\w+?\.\w+?$
<$list filter="[titleis[missing]]" variable="missingTiddler"
>
<$list filter="[{!!title}regexp]">
Tiddler is missing and in w3w format


<$list filter="[title!is[missing]]" variable=
"missingTiddler">
<$list filter="[{!!title}regexp]">
Tiddler is in w3w format



Now if a tiddler has a title of the form word.word.word the above will 
display according to if it exists or not.

Why is this so interesting?
If someone comes to my online wiki using a link such 
as mywiki.html#test.w3w.example
they will open the tiddler mywiki.html#test.w3w.example if it exists
if it does not exist they will presented with the missing tiddler, which I 
can code to have a button appear on it, to help the user create the tiddler.

This provides a way to guide a user into creating a tiddler that does not 
exist by a title they provide, that meets a naming standard. It could be 
firstname.surname

Regards
Tony


On Saturday, July 14, 2018 at 3:43:00 PM UTC+10, Mark S. wrote:
>
> TT is the real expert, but this may get you started:
>
> \define myregexp() ^\w+?\.\w+?\.\w+?$
> <]">>
>
> Regexp is SOOO slippery.Without knowing more about your data, and your 
> exact requirements, it's hard to know if this nails it. But you can test 
> and tweak it and see what happens.
>
> If you ever need to extract strings, then you will need something similar 
> to the solution in PR 2963.
>
> -- Mark
>
> On Friday, July 13, 2018 at 8:45:41 PM UTC-7, TonyM wrote:
>>
>> Folks,
>>
>> I have some tiddlers titled in the form name1.name2.name3
>>
>> I would like to test any tiddler title to test it is of this form, but 
>> not sure how to do so, even after some research
>>
>> Basically is it three words separated by "." periods
>> We can assume no other delimiters will be found such as spaces or [[ {{ 
>> etc..
>>
>> I imagine a regex expression can do It, but I have not yet undergone this 
>> self education
>>
>> I want to simply determine if it is true or not and reveal/listWidget 
>> some wiki text, 
>>
>> however one day I may want to extract the three words.
>>
>> Thanks in advance
>> Tony
>>
>

-- 
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/3afae344-e082-423d-8414-76d94cc04eb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-14 Thread TonyM
Mark,

Thanks, that will list all tiddlers with that title form (Exhaustive 
testing remains)

And the following will reveal if the current tiddler has this form

\define myregexp() ^\w+?\.\w+?\.\w+?$
<$list filter="[is[current]regexp]">





Thanks
Heaps


On Saturday, July 14, 2018 at 3:43:00 PM UTC+10, Mark S. wrote:
>
> TT is the real expert, but this may get you started:
>
> \define myregexp() ^\w+?\.\w+?\.\w+?$
> <]">>
>
> Regexp is SOOO slippery.Without knowing more about your data, and your 
> exact requirements, it's hard to know if this nails it. But you can test 
> and tweak it and see what happens.
>
> If you ever need to extract strings, then you will need something similar 
> to the solution in PR 2963.
>
> -- Mark
>
> On Friday, July 13, 2018 at 8:45:41 PM UTC-7, TonyM wrote:
>>
>> Folks,
>>
>> I have some tiddlers titled in the form name1.name2.name3
>>
>> I would like to test any tiddler title to test it is of this form, but 
>> not sure how to do so, even after some research
>>
>> Basically is it three words separated by "." periods
>> We can assume no other delimiters will be found such as spaces or [[ {{ 
>> etc..
>>
>> I imagine a regex expression can do It, but I have not yet undergone this 
>> self education
>>
>> I want to simply determine if it is true or not and reveal/listWidget 
>> some wiki text, 
>>
>> however one day I may want to extract the three words.
>>
>> Thanks in advance
>> Tony
>>
>

-- 
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/aad2b8ef-8ec4-4ca9-b853-d2d1c72196c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Test if a tiddler title is of a particular form

2018-07-13 Thread 'Mark S.' via TiddlyWiki
TT is the real expert, but this may get you started:

\define myregexp() ^\w+?\.\w+?\.\w+?$
<]">>

Regexp is SOOO slippery.Without knowing more about your data, and your 
exact requirements, it's hard to know if this nails it. But you can test 
and tweak it and see what happens.

If you ever need to extract strings, then you will need something similar 
to the solution in PR 2963.

-- Mark

On Friday, July 13, 2018 at 8:45:41 PM UTC-7, TonyM wrote:
>
> Folks,
>
> I have some tiddlers titled in the form name1.name2.name3
>
> I would like to test any tiddler title to test it is of this form, but not 
> sure how to do so, even after some research
>
> Basically is it three words separated by "." periods
> We can assume no other delimiters will be found such as spaces or [[ {{ 
> etc..
>
> I imagine a regex expression can do It, but I have not yet undergone this 
> self education
>
> I want to simply determine if it is true or not and reveal/listWidget some 
> wiki text, 
>
> however one day I may want to extract the three words.
>
> Thanks in advance
> Tony
>

-- 
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/94b8e943-ee45-415b-b0b0-a67a336f2975%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.