Please see this suggestion:

   - tiddler starts with capital letter: ^[A-Z]   instead of ^[A-Z].*$
   - tiddler starts with digits: ^[0-9] instead of ^[0-9].*$


What do you think?

--Mohammad

On Sunday, August 25, 2019 at 11:36:08 PM UTC+4:30, Mark S. wrote:
>
> Most of your examples have an implied scope of the entire tiddler title.
>
> That is, if the tiddler can only have lower case letters, then *every 
> single character* from start to end (^ to $) has to be lowercase.
>
> But duplicate words can start and end anywhere inside the title, so the 
> scope doesn't have to apply to every single character.
>
> So, it was my fault for churning them out *en masse*, using previous 
> versions as my template ;-) 
>
> Thanks!
>
> On Sunday, August 25, 2019 at 11:44:56 AM UTC-7, Mohammad wrote:
>>
>> Thanks Mark and Josiah,
>>  It seems the problem is with *^$*.
>>
>> I removed them and it works. But not sure where they  are required.
>>
>> @Josiah,
>>  I add the consecutive duplicate words!
>>
>> Thank you again
>>
>> --Mohammad
>>
>> On Sunday, August 25, 2019 at 10:34:13 PM UTC+4:30, @TiddlyTweeter wrote:
>>>
>>> Mohammad 
>>>
>>> I'm not sure how much spaced repetition is an issue really ("I had an 
>>> old an clock")? The commonest issue is simple sequential repeating ("I had 
>>> an an ...").
>>>
>>> But Mark's regex works on test data. Though I'd simplify it to ...
>>>
>>> (\b\w{2,}\b)(.*)\1
>>>
>>> Example match in test data (match in lines)...
>>>
>>> *-> ... <- is match*
>>>
>>> (\b\w{2,}\b)(.*)\1 ... spaced duplicate words to remove↩︎
>>> ↩︎
>>> This is a Tiddler ->This<- is Nice↩︎
>>> Nice Tiddler is This ->Tiddler<-↩︎
>>> Remove this repeat of ->this<- Tiddler repeat of ->repeat<-.↩︎
>>>
>>>
>>> TT
>>>
>>> On Sunday, 25 August 2019 17:29:10 UTC+2, Mohammad wrote:
>>>>
>>>> The duplicate words does not work!
>>>>
>>>> It seems only if the first word of title repeated it will be matched. 
>>>> Look at the below two tiddler titles
>>>>
>>>>
>>>>    1. This is a Tiddler This is Nice
>>>>    2. Nice Tiddler is This Tiddler
>>>>
>>>> The pattern will match the first but ignore the second while both have 
>>>> a duplicate word!
>>>>
>>>> --Mohammad
>>>>
>>>> On Friday, August 23, 2019 at 10:51:06 PM UTC+4:30, Mark S. wrote:
>>>>>
>>>>> Ok, with duplicates and date formats. Note that the date formats only 
>>>>> check for the format. You could still create
>>>>> nonsensical dates that actually match the formats (Jan 55 9999, 
>>>>> 1111.15.55). Actual validation of dates would take
>>>>> real code massaging.
>>>>>
>>>>> <$vars digonly="^[0-9]*$">
>>>>> <$vars useme=<<digonly>>>
>>>>> </$vars>
>>>>> </$vars>
>>>>>
>>>>> <$select tiddler="myregexp">
>>>>> <option value="^[0-9]*$">Only digits</option>
>>>>> <option value="^[a-z]*$">Only lower case</option>
>>>>> <option value="^[A-Z]*$">Only upper case</option>
>>>>> <option value="^[\w-_]*$">Only alphanumeric, _, and -</option>
>>>>> <option value="^[\w]{3,15}$">Only alphanum len 3-15</option>
>>>>> <option value="^[A-Z]+.*$">Starts with capital</option>
>>>>> <option value="^[0-9]+.*$">Starts with digit</option>
>>>>> <option value="^.+\.[a-zA-Z]{3,4}$">Extensions only</option>
>>>>> <option value="^.+(\.jpg|\.gpeg)$">Extension jpg gpeg</option>
>>>>> <option value="^\b(\w{2,})\b.*\b\1\b.*$">Duplicate words</option>
>>>>> <option value="^\b(\w{2,})\b.*\b\1\b.*$">Duplicate words</option>
>>>>> <option value=
>>>>> "^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1}\d{2}\s\d{4}$"
>>>>> >Date like Jan 06 2019</option>
>>>>> <option value="^\d{4}\.[0-1]\d\.[0-3]\d$">Date like 2019.08.25
>>>>> </option>
>>>>> </$select>
>>>>>
>>>>> <$list filter="[regexp{myregexp}sort[]]">
>>>>>
>>>>> </$list>
>>>>>
>>>>>
>>>>>
>>>>> On Friday, August 23, 2019 at 12:11:07 AM UTC-7, Mohammad wrote:
>>>>>>
>>>>>> I am looking for examples and use cases of regexp in Tiddlywiki!
>>>>>> Those can be done current filter operators like prefix, search,... 
>>>>>> are not recommend to be done with regexp.
>>>>>>
>>>>>> I appreciate your help, case and examples on this. Just give what you 
>>>>>> want to do.
>>>>>>
>>>>>> Some case
>>>>>>
>>>>>> Give a regexp pattern in Tiddlywiki to match all tiddlers name are
>>>>>>
>>>>>>
>>>>>>    1. only digits
>>>>>>    2. only lowercase letters
>>>>>>    3. only uppercase letters
>>>>>>    4. only alphanumeric and underscore and hyphen
>>>>>>    5. only alphanumeric with length between 3 and 15
>>>>>>    6. start with a capital letter
>>>>>>    7. start with a digit
>>>>>>    8. have a extension like mytiddler.ext
>>>>>>    9. have jpg or jpeg extension like *mytiddler.jpg* or 
>>>>>>    *mytiddler.gpeg*
>>>>>>    10. are a date in format like Jan 06 2019 
>>>>>>    11. are a date in format like 2019.08.25 
>>>>>>    12. have duplicate words
>>>>>>    13. have a valid url
>>>>>>    14. 
>>>>>>    
>>>>>>
>>>>>> [This list will grow by more examples]
>>>>>>
>>>>>>
>>>>>> Please give your use case.
>>>>>>
>>>>>> -- 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/eb2f4d4a-90ff-4576-9a54-ae994cf6ddcf%40googlegroups.com.

Reply via email to