mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

598
comptes actifs

#regexp

0 message0 participant0 message aujourd’hui
kalvn<p>✨ Nouveau post : </p><p>L'essentiel sur les expressions régulières en JavaScript</p><p><a href="https://kalvn.net/blog/l-essentiel-sur-les-expressions-regulieres-en-javascript/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">kalvn.net/blog/l-essentiel-sur</span><span class="invisible">-les-expressions-regulieres-en-javascript/</span></a></p><p><a href="https://mastodon.xyz/tags/JavaScript" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>JavaScript</span></a> <a href="https://mastodon.xyz/tags/RegExp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExp</span></a> <a href="https://mastodon.xyz/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a></p>
Piiieps & Brummm<p>Just going through the logs of my own mail server (Thanks, <span class="h-card" translate="no"><a href="https://io.mwl.io/@mwl" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>mwl</span></a></span> !) to extend my <a href="https://chaos.social/tags/postfix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>postfix</span></a> <a href="https://chaos.social/tags/fail2ban" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fail2ban</span></a> <a href="https://chaos.social/tags/regexp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexp</span></a> to ban hosts with too many unsuccesful login attempts. Knowing the user name pattern (example.com only letters, others with at least one dot) I came up with</p><p>'warning: .*\[&lt;HOST&gt;\]: SASL LOGIN authentication failed: .*sasl_username=&lt;F-USER&gt;(?:[^.]*@(?!example\.com)|[^.]*\.[^.]*@(?:example\.com))&lt;/F-USER&gt;'</p><p>This works great.</p>
𝙹𝚘𝚑𝚊𝚗<p><a href="https://cr8r.gg/tags/TFW" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TFW</span></a> <a href="https://cr8r.gg/tags/regexp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexp</span></a> в 6 строчек, написанный <a href="https://cr8r.gg/tags/ChatGPT" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ChatGPT</span></a>, парсит <a href="https://cr8r.gg/tags/Markdown" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Markdown</span></a> <em>более лучше</em> ①, чем тысячи строк <a href="https://cr8r.gg/tags/Redcarpet" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Redcarpet</span></a> ② под капотом у <a href="https://cr8r.gg/tags/GlitchSoc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GlitchSoc</span></a> 😔</p>

New at PragProg

Staffan Nöteberg helps you really understand how the machinery works under the hood. Learn advanced tools like reluctant, lookbehind and nondeterministic finite automata to write efficient and elegant regexes with ease.

In this illustrated guide, you gain precisely that understanding., even with no prior knowledge of Regular Expressions.

pragprog.com/titles/d-snrem

@staffannoteberg

A répondu dans un fil de discussion

@tripleo You’re thinking of #Perl’s “taint mode” (stop your teenage giggling), where outside data is untrusted unless it’s the extracted subpattern match in a #RegularExpression.

It’s only enabled under certain conditions. Read about it in the `perlsec` manual page: perldoc.perl.org/perlsec#Taint

perldoc.perl.orgperlsec - Perl security - Perldoc Browser

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

Une idée incroyable : au lieu d'interpréter le pattern d'une expression régulière à l'exécution, cette librairie crée une classe Java exécutant le pattern au moment du build. Ca optimise considérablement l'exécution du code, évidement. Par contre, je ne vois pas (encore) comment intégrer ça dans un projet "classique" : pas de plugin maven ou de configuration de compilateur. Il y a donc … github.com/hyperpape/needle #java #regexp #library #optimisation #compilation #opensource

GitHubGitHub - hyperpape/needle: Compiling string matching algorithms and regular expressions to java bytecodeCompiling string matching algorithms and regular expressions to java bytecode - hyperpape/needle