toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

198
active users

#regularexpression

0 posts0 participants0 posts today

Sharkey supports Regular Expressions for your hard and soft word mutes. Mastodon should too! If not raise holy hell with them.

The syntax for a case-insensitive
#RegEx (#RegularExpression) for blocking "international airport" or "physical therapy" would be:

/.*international ?airport*./i
/.*physical ?therapy*./i

This would match:
- international airport
- International Airport
- InternationalAirport

And so on. Also, I'm purposefully not using any common triggers so as not to trigger any one.

Once you go regex in your word mutes you'll never want to go back to plain words ever again.


RE: https://social.growyourown.services/users/FediTips/statuses/114604240538234292

social.growyourown.servicesFedi.Tips (@FediTips@social.growyourown.services)You don't need to use weird spellings or algospeak for any topics on the Fediverse ("unalived", "seggs" etc). There is no automated moderation or algorithm on here, moderation happens entirely through human beings and posts are shown in chronological order. In fact it's better that you use the correct spellings for difficult topics so that people with genuine traumas related to them can filter them more easily. #FediTips

My PhD student was still feeling uncomfortable with #regex, so I searched and found these awesome regex games that can help you improve your regex-fu and help you have some fun during your daily commute:

regexcrossword.com

the-regex-game.com/?level=inte

and this imho is more geared towards beginners:

regexone.com

Regex CrosswordRegex CrosswordA crossword puzzle game using regular expressions. Earn achievements completing puzzle challenges. Easy tutorials for people new to regular expressions.

Things I Learned Today
#TILT #bash #linux
Still working on #regularExpression in bash.

re='^~\s~\s~'
if [[ "${lineN}" =~ ${re} ]] ; then bla bla bla...

The extra variable declaration is needed; found on web
"While not always necessary, it is advisable to store the regex in a variable first, because Bash has trouble with regex literals containing \."

I see a lot of unnecessarily specific regexs (typically excessive captures & pointless `.*$`) being used. Logic says they'll be slower so I spent about 90 seconds testing an example on 3 in-browser JS benchmark apps.
Comparing:
`/^(Hello), this is a string (.*)$/` to
`/^Hello, this is a string /`
the latter is 1.5-5x faster on all 3 apps.
#RegEx #RegExp #RegularExpression

It is a known fact that the magic of a #RegularExpression degrades with each word of comment you explain it with. Wizardry is achieved when your regex has to be broken up into multiple lines of, say, #Python, uses nested parentheses, line beginning or ending operators ^ and $, and gets assigned to an inscrutable variable name.

These are secrets jealously guarded by The Old Man #Programming Guild.

/s

#EmacsTip: It is always better to use #Rx instead of raw #RegularExpression, because they are error-prone, especially the escapes. But if you need to use raw #RegularExpression, install #Relint, a #RegularExpression linter for #EmacsLisp. Just run relint-current-buffer in your buffer, it will find most of your #Regex bugs.

github.com/mattiase/relint

GitHubGitHub - mattiase/relint: Elisp regexp lint toolElisp regexp lint tool. Contribute to mattiase/relint development by creating an account on GitHub.