Email or username:

Password:

Forgot your password?
Ivory by Tapbots :emoji_wink:

Keyword Filter Tip:
Sometimes simple keywords pick up longer words. If you add a keyword filter for “Elon”, it will also filter posts with the word "belong" or "felony".

Solution:
Regular Expressions. Go to your filters tab by holding down on one of the last 3 tab buttons. Add Keyword and enter \(space)yourkeyword(space). You should also see a new "Regex" option appear when you hit that backslash. Turn that on. Test your results by scrolling down and checking "Matching Posts”.

100 comments
Ivory by Tapbots :emoji_wink:

Regular Expressions allow you to filter your posts in powerful ways. A good place to test new expressions to make sure they work properly is at regex101.com

Have fun!

Jens

@ivory You might want to rather use \b instead of (space), so you're also able to match hashtags and other non-alpha-numeric chars.

Cedric :ivory_logo:

@ivory @daskaja How to include capital letters? "Elon" is not counted

Jens

@cedric @ivory \b[Ee][Ll][Oo][Nn]\b - not nice, but works

Jakub

@daskaja @cedric @ivory
To ignore case sensitive type:

(?i)\belon\b

xinit ☕

@cedric

Yeah, a /i would be a help, for sure. Maybe [Ee]lon would work? I don't subscribe, and regex is one of the sub-only features.

On a tangent, wouldn't it be nice to have search/replace option in addition to basic filtering? Imagine /elon/shitbird/gi as a global filter, @ivory @daskaja

[aware event]

@xinit @cedric @ivory @daskaja Try

(?i)\belon\b

But yeah, it should probably be in the UI.

xinit ☕

@Wevah

I'm out of regex practice, but the (?i) checks out on regex101.com

@cedric @ivory @daskaja

burgatshow

@daskaja @ivory also a /i flag to make it case insensitive. ;)

Jens

@burgatshow @ivory I wasn't sure if modifiers were supported here, since the GUI is a bit misleading. But if so, better use /i

burgatshow

@daskaja @ivory sure. You are right. It is more like a suggestion to @ivory to implement the switch for case sensitivity.

Aaron Mahler

@daskaja @ivory Seemed a good test question to pose to ChatGPT - which resulted in precisely your same \b recommendation along with a decent description of the reasoning. I did that before seeing your reply, so not saying it validated your answer - more the other way around. :)

Paul

@ivory Like the topic you‘ve chosen for your example regex… 🤫

James Gilbert

@ivory One of my favourite sites is RegExper, which visualises regular expressions. Useful if they are more complex.
regexper.com/#%5Cbelon%5Cb

Mark Boszko

@ivory which flavor should we pick in the left column to match how Ivory will interpret the regex?

Ivory by Tapbots :emoji_wink:

@swizzlevixen For basic pattern matching, I didn't change the flavor. I am not a regex expert. Just wanted to provide a basic solution to a very common problem people have with keyword filters. 🙂 If you want to know more about what we use, you can go here: unicode-org.github.io/icu/user

Jon Michaels

@ivory This is AWESOME! Thank you!

I would strongly recommend Chapter 8 of the BBEdit Manual for anyone who wants to learn more about Regular Expressions. It's my go-to whenever I need help with a tricky pattern match.

I believe we have @gruber to thank for that one.

It is available here:

barebones.com/support/bbedit/m

Lady Di

@ivory 🙂 That topic example choice! 👍🏻💕

Kevin Riggle

@ivory oh ffs you couldn’t just wrap the keywords in ‘\b…\b’ like everyone else does and all your users expect from decades of Google and other full-text search engines

Sascha

@ivory Regex and Fun in one sentence… 🤣

Martin the paranoid android

@ivory \byouknowwho\b gets initial Youknowwho and when punctuation follows.

Tim from the Island💫♥️🇮🇲

@ivory As someone who has been a software developer for over 30 years, I can definitely state that regexes are the work of satan

Martin Porcheron

@ivory this looks great, although couldn’t a shortcut option be made available for people who don’t know what regex is? (E.g. match whole word only option?)

Ivory by Tapbots :emoji_wink:

@mporcheron We plan to revamp our keyword filter creation tools at some point. But for now this works well. 🙂

Peter Christensen

@ivory What an strangely specific example. 🤣 Keep up the great work, guys. Love what you do.

Parsingphase

@ivory OK please tell me you're going to support full PCRE so I can get disproportionately excited by a mobile app

Lizard

@ivory I'm not so certain that including "felony" when searching for "Elon" is an error. :)

Michael Gemar

@ivory I love Ivory, but requiring regex knowledge to force matching the exact thing I enter for search is TERRIBLE for new users. You can give users the *option* to use regex, but the *default* should only match exactly what is requested. The “solution” offered is making users fix unexpected geeky behaviour by the app back-end. This is NOT newbie-friendly.

David Harrison

@michaelgemar @ivory But that IS the default. You have to enable regex.

Michael Gemar

@dharrison @ivory The default is for it to match letter-strings as part of larger words. That’s not what regular folks will expect.

Ivory by Tapbots :emoji_wink:

@michaelgemar Yes we plan to revamp our keyword tools in the future, but this is what we have now. 🙂 We get people asking how to solve this problem on occasion and we wanted to share the current solution.

Michael Gemar

@ivory That’s cool — I know things are happening very fast. I just wanted to flag that the solution offered was less than ideal, and a more friendly long-term fix is desirable.

zıəs uɐɟəʇs ✪

@ivory If the regex should also match when there is no Space before the searchstring (i.e. it is at the beginning of the test), use a regex like this (not tested in ivory):\belon\b
\b denotes a word boundary

Gemini6Ice

@seiz @ivory I was about to reply to confirm ivory supported /b

xinit ☕

@ivory The trouble you get in with a regex like that, though, is that it doesn't block out "Elon." or "#IdiotElon" constructs.

Would something like

\b(elon)\b

Also work to match word boundaries?

Tom Winzig

@xinit @ivory It should, and the ( ) are not needed here, just \belon\b

[DATA EXPUNGED]
Dr Lee A. Christie

@ivory It’s not matching his full name Elongated Muskrat.

Jason Petersen

@0x1ac i think it’s implicit you should just block people who speak like that

James Gilbert

@ivory I guess they are always case insensitive. What regular expressions are supported?
Wouldn't it make the feature more discoverable if the toggle was visible before entering a punctuation character?

Ivory by Tapbots :emoji_wink:

@jgrg unicode-org.github.io/icu/user

We intentionally hid the toggle because too many people would probably turn it on without knowing what it is for.

James Gilbert

@ivory Maybe have an "Advanced" option to reveal it? I'm just worried that I would never have discovered it, and I think it is such a great feature.

Thomas Blätte

@ivory oh my, this is exactly what I needed. (With this exact example) 😅
Thank you so much!

dfbills

@ivory I love your choice of matching words... Elon, belong, felony

Bryan Culver

@ivory feature request: Shared Filters/Filter Lists, akin to the Drafts ecosystem. I’m sure the Space Enron filter set would be very popular.

Sunny 🟦

@ivory

A solution only an opensource hacker could love and only a 13 yr old computer hack would stumble across.

"Oh look! If you put a slash and a space in there this other thing shows up and if I do this to the other thing then it does what I wanted in the first place.... VOILAH!!!" Now I'm a power user!

Its like intuitively knowing that if you make Mario jump and punch the mushroom, coins will fly out.🤣

Nick from Toronto

@ivory I love the little bit of shade.

But in seriousness, thank you for making an awesome app that makes this new place feel more comfortable.

Todd Smith

@ivory I was today years old when I discovered Ivory's filter interface.

I kept looking for it in the top-left menu, didn't find it, and thought it was absent because Ivory is still in development. 😭

Ivory by Tapbots :emoji_wink:

@todd_smith That means you found a few more sections as well then? 🙃 We plan on revamping our navigation system soon which will make it easier to find all the hidden sections.

Todd Smith

@ivory Yup!

Another one was "Oh, they DO have lists!"

There have been some high-volume people from Twitter that I haven't been following (via bird.makeup) because I was trying to do everything from the Home timeline. I am much happier now. 😊

Rye

@ivory I know masto leans super tech-literate, but maybe this justifies a “match whole word only” toggle for the masses that constructs the appropriate regex in the background?

Ivory by Tapbots :emoji_wink:

@rye For sure! We plan to update our whole filter building system at some point. 🙂

Penguin

@ivory Thank you, that’s very useful.

Michael

@ivory are flags supported as well? I.e. "\ elon/i"

Comrade Weez

@ivory If you add a keyword filter for “Elon”, it will also filter posts with the word "felony," which is entirely correct. 🤭

Alessandro

@ivory have you considered importing the filters from Tweetbot? Right now it's... somewhat difficult to copy them over.

ednl 🇪🇺

@ivory I think by default a normal (not regex) keyword filter should only match on whole words or hashtags. Moreover, while I love regex, I don't think many people know or care about them. So perhaps a more useful switch for most would be: "whole word / contains".

postweber

@ivory but can I apply a keyword filter to only one user?

danny_wonglh

@ivory How to use regex to filter someone mentioning some keywords?

nSonic

@ivory @egghat a classic 😄 most users wouldn’t expect that to happen (filtering words by parts of it).

Advanced users would expect they could do it with a wildcard like „Elon*“, „*elon*“ and so on

RegEx always looks like an over engineered thing … and as always: one gives a simple example/solution with three extra chars - it didn’t take long to see a fullblown, respect all edge cases, two side long expression 🤣 (I’m exaggerating a bit, but you may get the point)

Jan

@ivory is it possible to update server-defined filters in the app?

Dave Olsen

@ivory I love the example you’ve given. 👌🏻

Stefanus

@ivory bug, Tap the tabs below in succession, and this appears

Elijah Miller

@ivory I love this, but maybe something for the non-regex-fluent among us? like a “word" checkbox that adds word boundary stuff to the original version?

Go Up