Mark Gardner ‍:sdf: · @mjgardner
704 followers · 4719 posts · Server social.sdf.org
hanscees · @hanscees
403 followers · 4339 posts · Server social.sargasso.nl

Solved today in import script.
Took me two weeks to find what went wrong.
Turns out if the host variable in the import script has no "http" in it, host is not recorded in database.
You gotta love

#bug #matomo #regexps

Last updated 1 year ago

Mark Gardner ‍:sdf: · @mjgardner
661 followers · 4097 posts · Server social.sdf.org

@regehr @commodore @dev There is even a (low-severity, a/k/a “cruel”) policy to discourage everything but $_, @_, $], and numbered capture variables: metacpan.org/pod/Perl::Critic:

metacpan.org/pod/Perl::Critic: already protects you against the performance-sapping $`, $&, and $' match variables

And you can configure your own prohibited list with metacpan.org/pod/Perl::Critic:

#perlcritic #regularexpression #perl #regex #regexp #regexes #regexps

Last updated 1 year ago

Spent half a day polishing complex in . And they work too, but perl has a little different standard, so I'm basically stuck in grep -p punching a file until it works. As they say in , sometimes you just have to brute force prototype.

#regexps #vim #taoup #unix #bashcore #hobbylinguist #hobbytranslator

Last updated 2 years ago

Mark Gardner ‍🤑 · @mjgardner
496 followers · 2089 posts · Server social.sdf.org

@Codely @drupler It helps to build your complicated in pieces and store them in separate variables. You can then test them in isolation and not be confused when you concatenate them together for your actual matching.

Both and also support named capture groups if you’re doing replacements. They’re a lot more readable.

Also, PHP’s -based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.

#regularexpressions #php #javascript #pcre #regexes #regexps

Last updated 2 years ago

Brendan Halpin · @bthalpin
359 followers · 1879 posts · Server mastodon.social

In the absence of , my anti-twitter-RTs filter is now

twitter.com/

The trailing backslash catches links to tweets (twitter.com/screenname/12345 etc) but allows other mentions of twitter.com, e.g., a username.

#mastodon #filter #regexps

Last updated 2 years ago

Mark Gardner ‍🤑 · @mjgardner
424 followers · 1616 posts · Server social.sdf.org
Mark Gardner ‍🤑 · @mjgardner
416 followers · 1569 posts · Server social.sdf.org

@sjn @cb 99% of the “ is line noise” complaints are because of unformatted . Every language worth anything eventually supports them, but only @Perl (and , earlier) makes them first-class citizens. And with Perl you can format and comment them for readability: perldoc.perl.org/perlretut#Emb

We format the rest of our code for humans. Why not ?

can warn against bad regexps: metacpan.org/search?size=200&q

#perl #regularexpressions #awk #regexps #perlcritic #regex #regexes #programming #coding #softwaredevelopment

Last updated 2 years ago

Mark Gardner · @mjgardner
370 followers · 1134 posts · Server social.sdf.org

@randomatic @ChristosArgyrop@mstdn.science @HaplogroupNews @ChristosArgyrop@mastodon.social A previous employer of mine used re::engine::RE2 for many things, because a) you can cap the memory usage to avoid attacks, and b) the lead developer was all about premature optimization. metacpan.org/pod/re::engine::R

But you can’t use the /x flag for better readability, and we ran into some nasty bugs and had to fall back to regular Perl in those cases.

#dos #unicode #regexps

Last updated 2 years ago

GenghisKen Coar · @GenghisKen
70 followers · 274 posts · Server ruby.social

@Xiy
I was unclear; I use either ! or § for (%r, %R) but [...] for others of these... whatever you call them, because they define arrays.

#regexps

Last updated 2 years ago

GenghisKen Coar · @GenghisKen
70 followers · 274 posts · Server ruby.social

@Xiy
I use this a lot for expressions; I typically use %𝚛!...!. Also, for arrays of symbols; less commonly for arrays of strings. Oddly enough, I'll use paired delimiters (such as brackets, braces, or parentheses) for any 𝘰𝘵𝘩𝘦𝘳 list of this sort, just not . Mostly brackets, since its an array.

I found locating an authoritative list of these, by implementing Ruby version, much more of a chore than I expected.

#ruby #regular #regexps

Last updated 2 years ago

Lizakowski 🌈 · @lizakowski
40 followers · 30 posts · Server sfba.social

I'm trying some for hiding posts by default:

SportsBall
Exagerration
Politics
RightWing
Tragedy
BuzzwordTrash (e.g. Kardashian or NFT)

The filters can do quite a bit without .

#filters #regexps

Last updated 2 years ago