photog.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for your photos and banter. Photog first is our motto Please refer to the site rules before posting.

Administered by:

Server stats:

246
active users

#regularexpressions

0 posts0 participants0 posts today
JdeBP<p><span class="h-card" translate="no"><a href="https://mastodon.social/@cks" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>cks</span></a></span> </p><p>Warning: rabbit hole</p><p><a href="https://polymaths.social/@rl_dane/statuses/01K1XR4D4GCKDD7PQMSRAMV5EA" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">polymaths.social/@rl_dane/stat</span><span class="invisible">uses/01K1XR4D4GCKDD7PQMSRAMV5EA</span></a></p><p>You'll recognize this one as well, no doubt. There's probably an old Usenet FAQ somewhere with it, although I haven't checked.</p><p>But it got me to thinking of when the idea of a-z collating *entirely after* A-Z became a norm; only to falter again when ASCII systems met other countries. When the era was.</p><p>I checked with a couple of my old printed dictionaries from the 20th century, and they had case-insensitive collation in English. One even put 'a' ahead of 'A'.</p><p>It's definitely thus an <a href="https://mastodonapp.uk/tags/ASCII" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ASCII</span></a> notion, but did it pre-date <a href="https://mastodonapp.uk/tags/Unix" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Unix</span></a>? Did it pre-date regular expression syntax? Or shell globbing?</p><p>My initial educated guess would be that the golden period of A-Za-z was the middle 1960s with ASCII and some Unix predecessor to the early 1990s when all of the books/posts/whatnot on the new Standard C were spreading the knowledge of locales.</p><p><a href="https://mastodonapp.uk/tags/UnixHistory" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>UnixHistory</span></a> <a href="https://mastodonapp.uk/tags/retrocomputing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>retrocomputing</span></a> <a href="https://mastodonapp.uk/tags/locales" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>locales</span></a> <a href="https://mastodonapp.uk/tags/collation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>collation</span></a> <a href="https://mastodonapp.uk/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RegularExpressions</span></a> <a href="https://mastodonapp.uk/tags/fnmatch" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fnmatch</span></a></p>
Alvin Ashcraft 🐿️<p>Using Regular Expressions (Regex) in SQL Server 2025: A Complete Guide.</p><p><a href="https://www.red-gate.com/simple-talk/featured/using-regex-in-sql-server-2025-complete-guide/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">red-gate.com/simple-talk/featu</span><span class="invisible">red/using-regex-in-sql-server-2025-complete-guide/</span></a> </p><p><a href="https://hachyderm.io/tags/regex" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>regex</span></a> <a href="https://hachyderm.io/tags/sqlserver" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlserver</span></a> <a href="https://hachyderm.io/tags/database" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>database</span></a> <a href="https://hachyderm.io/tags/sql" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sql</span></a> <a href="https://hachyderm.io/tags/regularexpressions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>regularexpressions</span></a></p>
benda<p><a href="https://kolektiva.social/tags/fedihelp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fedihelp</span></a> <a href="https://kolektiva.social/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://kolektiva.social/tags/regex" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>regex</span></a> <a href="https://kolektiva.social/tags/regularexpressions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>regularexpressions</span></a> </p><p>someone please help me understand how this /regex/d bit of code works (links to a better resource than f'ing w3s also satisfactory).</p><p><a href="https://www.w3schools.com/js/tryit.asp?filename=tryjs_regexp_indices" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">w3schools.com/js/tryit.asp?fil</span><span class="invisible">ename=tryjs_regexp_indices</span></a></p><p>why does it not return, for example, "aaaabb"?</p>
rk: it’s hyphen-minus actually<p>I have written regular expression engines, in multiple languages and with various performance guarantees. I have written multiple peer-reviewed academic papers on regular expressions, and presented at multiple conferences on them. I was invited to lecture on regex transformations for multiple three-letter agencies. </p><p>Anyway yeah any time I write a regex I fuck it up. </p><p><a href="https://mastodon.well.com/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://mastodon.well.com/tags/regularExpressions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>regularExpressions</span></a></p>
Patrick Johanneson 🚀 🇨🇦<p>This worked on the first try.</p><p><code>:%s/^\(.*@[^"]\+"\),.*/\1/g</code></p><p><a href="https://mstdn.ca/tags/RegEx" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RegEx</span></a> <a href="https://mstdn.ca/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RegularExpressions</span></a> <a href="https://mstdn.ca/tags/vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vim</span></a></p><p>I fully expect two kinds of responses to this:</p><ol><li>What is this, amateur hour?</li><li>What the <em>fuck</em> is <em>that</em>?</li></ol>

Weekend reading for code obsessives, based on my current work adding semi-full regular expressions to Quamina. Two blog entries, coding recommendation, and a quiz/challenge.
1. QRS: Quamina Regexp Series - tbray.org/ongoing/When/202x/20
2. QRS: Parsing Regular Experssions - tbray.org/ongoing/When/202x/20

[If you don’t know what a “regular expression is”, please ignore this, and don’t feel bad, because nobody should have to know that.]

Replied in thread

@sjn @cb 99% of the “#Perl is line noise” complaints are because of unformatted #RegularExpressions. Every language worth anything eventually supports them, but only @Perl (and #awk, 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 #regexps?

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

perldoc.perl.orgperlretut - Perl regular expressions tutorial - Perldoc Browser
Replied in thread

@RL_Dane @benjaminhollon @marcxjo #PCRE was "inspired by" #Perl #RegularExpressions. It was developed as a replacement for the original Spencer #regexp library used by the #Exim mail transfer agent. Although there has been some cross-pollination of features, they're independent projects with different goals.

#PCRE2 documents some of its differences with Perl here: pcre.org/current/doc/html/pcre

www.pcre.orgpcre2compat specification

#RegularExpressions #JavaScript:

Putting a question mark after a quantifier such as {1,3} or * or + makes that quantifier _reluctant_—it matches as little as possible:

> /^(#{1,3}?)(#*)$/.exec('####').slice(1,3)
[ '#', '###' ]
> /^(#{1,3})(#*)$/.exec('####').slice(1,3)
[ '###', '#' ]

exploringjs.com/impatient-js/c

exploringjs.comRegular expressions (`RegExp`) • JavaScript for impatient programmers (ES2022 edition)