Ciao Mark

I played around with it. 3 main tests are here: 
https://tidbits.wiki/reginald/tw_regex.html

The solution ALLOWS for the "Falcon(7)" case. (BTW the visual presentation 
of the case makes it look like the first (7) is removed--actually that is 
just a limitation of the difference engine in TW. Its the second (7) that 
actually matches.) 

My feeling here is ADVISE against "Falcon(7)", but not prevent it matching. 

The tests assumes that the basic pattern is ...

[wikiname-literal][regex-of-number-cruft][.extension-literal]


The regex I came up with is ...

(\s*\(\d+\))*


This means ...

    Match 0 or more spaces as many times as possible
    Match left bracket
    Match any number
    Match right bracket

    And repeat the pattern as many times as possible

This a JavaScript regex.  

I'm pretty sure it compatible with PowerShell. Let me know if you have any 
problems.

Best
TT


On Monday, 22 July 2019 18:05:41 UTC+2, Mark S. wrote:
>
> It's probably time to reconsider the file-globbing versus regular 
> expression approach. File-globbing was good, but it does limit the name 
> comparisons.
>
> You're good with regular expressions ;-)
>
> What would be a good matching rule so that  stem matches
>
> stem(1)
> stem (1)
> stem (1)(2)
>
> BUT NOT
>
> stem (old)
> stem (john)
>
> I'm thinking that a match that searches for    stem<space>*<left 
> brace><number><non-greedy-indicator>
>
> This would mean people couldn't deliberately use (number) in their stem 
> names, but would open up stems that
> currently would match (e.g. polly vs polly-dev)
>
> Thanks!
>
> On Monday, July 22, 2019 at 5:03:34 AM UTC-7, @TiddlyTweeter wrote:
>>
>> Ciao Mark S.
>>
>> An interesting potential "caught on your own petard" issue came up :-).
>>
>> I wanted to change the online-name of the current "polly.html" to 
>> "polly-dev.html". And create a new "polly.html" for basic documentation. 
>> But, according to our own rules, I can't do that. 
>>
>> But It seems a bit odd to have to create "polly-doc.html" to address what 
>> may be a broad need. "Polly.html" would be a lot better I think for first 
>> contact?
>>
>> Yours in the stem :-)
>>
>> TT
>>
>

-- 
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/858725b6-283d-4b5e-87e9-50896790f1bf%40googlegroups.com.

Reply via email to