Filter to select UPPERCASE titles

131 views
Skip to first unread message

Alex Hough

unread,
Mar 31, 2017, 6:15:51 AM3/31/17
to TiddlyWiki
Hello all,

A set of tiddlers is formed by their titles being all upper case.

INDEX
GLOSSARY

I could tag these, but I wondered about selecting them based on regex filter. Using https://regex101.com/ I got this far 


Inline images 1

However when I put the term into TW's regex filter I get no return


Here is a minimal test case : https://alexhough.github.io/RegexAllCaps.html

Any pointers most welcome

Alex

Mark S.

unread,
Mar 31, 2017, 9:38:25 AM3/31/17
to TiddlyWiki, Tiddl...@googlegroups.com
This one seems to work:

 value="^[^a-z]*$"

Alex Hough

unread,
Mar 31, 2017, 10:23:45 AM3/31/17
to TiddlyWiki
Thanks Mark!

i know next to nothing about regex... could you recommend a good place to look?

I've updated my test case

Alex

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@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/5bcaf272-a433-41ff-a65d-edcea88bedd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Mar 31, 2017, 11:07:29 AM3/31/17
to TiddlyWiki
Dear Alex,

Regex101 is a great place to learn and experiment with. Just make sure that you select the appropriate regex flavour. See the image attached 




El viernes, 31 de marzo de 2017, 16:23:45 (UTC+2), AlexHough escribió:
Thanks Mark!

i know next to nothing about regex... could you recommend a good place to look?

I've updated my test case

Alex
On 31 March 2017 at 14:38, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:
This one seems to work:

 value="^[^a-z]*$"




On Friday, March 31, 2017 at 3:15:51 AM UTC-7, AlexHough wrote:
Hello all,

A set of tiddlers is formed by their titles being all upper case.

INDEX
GLOSSARY

I could tag these, but I wondered about selecting them based on regex filter. Using https://regex101.com/ I got this far 


Inline images 1

However when I put the term into TW's regex filter I get no return


Here is a minimal test case : https://alexhough.github.io/RegexAllCaps.html

Any pointers most welcome

Alex

--
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+...@googlegroups.com.

Alex Hough

unread,
Apr 1, 2017, 3:24:12 AM4/1/17
to TiddlyWiki
Ah!

Thanks Danielo!

very helpful, i was going crazy

Alex

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mat

unread,
Apr 1, 2017, 8:45:47 AM4/1/17
to TiddlyWiki
AlexHough wrote:

i know next to nothing about regex... could you recommend a good place to look?

@TiddlyTweeter

unread,
Apr 1, 2017, 10:19:44 AM4/1/17
to TiddlyWiki
the power of RegEx combined with TW is a box well worth opening IMO.

in some ways much going on in TW is enhanced RegEx veiled in JavaScript :-).

Best wishes
Josiah

Douglas Counts

unread,
Apr 5, 2017, 4:10:07 AM4/5/17
to TiddlyWiki, Tiddl...@googlegroups.com
Sorry to say, but your solution is faulty as you will get hits on any title without a lowercase letter. Naming a Tiddler "???" for example will also appear in your list.

You should use:

value="^[A-Z]+$"

if you wish to capture all cap titles that may also end with exclamation points, do this:

value="^[A-Z]+[!]*$"

If you want all caps that may end with or without exclamation points or question marks, do this:

value="^[A-Z]+[!?]*$"

If you want those plus titles that are all question marks or exclamation points [like ??? or !!!! titles] do this:

(^[A-Z]+[!?]*$)|(^[!?]+$)

It is always better to capture what you do want, not to capture everything but with a few exceptions. Otherwise, you open the door open to let in things you hadn't thought of.

-Doug

Douglas Counts

unread,
Apr 5, 2017, 4:51:15 AM4/5/17
to TiddlyWiki, Tiddl...@googlegroups.com
I left spaces out of my examples.  So all caps with spaces is:

value="^[A-Z\s]+$"

If you will also accept ? or !, but only at the end, then do this:

value="^[A-Z\s]+[!?]*$"

If you had a tiddler titled "RELEASE 5.0.181-BETA", your current RegEx would have captured that too.

"33333" would also have been captured. Examples like these are why you want to capture specifically what you are looking for.

-Doug
Reply all
Reply to author
Forward
0 new messages