Shout-out to https://rubular.com for being a very helpful and reliable tool for more than 15 years.
Shout-out to https://rubular.com for being a very helpful and reliable tool for more than 15 years.
It's good to know your tools and some regular expressions.
Just sayin'
Nouveau post :
L'essentiel sur les expressions régulières en JavaScript
https://kalvn.net/blog/l-essentiel-sur-les-expressions-regulieres-en-javascript/
Mikäs helvetin bait and switch tämä on?
Firefoxin js-konsoli "ennustaa" etukäteen, että testin tulos on `true` (mikä on oikein), mutta kun sen suorittaa, tulos onkin `false`.
Node antaa tulokseksi `true`. Samoin Chromiumin konsoli.
Itse asiassa, kun "ennustusta" pyytää uudelleen ja uudelleen, se antaa vuorotellen `true` ja `false`. Ja suorituksen vastaus riippuu siitä, kumpi ennustus on ollut viimeisimpänä.
Eli: Firefoxin konsolissa RegExpin test() ei ole luotettava.
#javascript #regexp
Just going through the logs of my own mail server (Thanks, @mwl !) to extend my #postfix #fail2ban #regexp 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
'warning: .*\[<HOST>\]: SASL LOGIN authentication failed: .*sasl_username=<F-USER>(?:[^.]*@(?!example\.com)|[^.]*\.[^.]*@(?:example\.com))</F-USER>'
This works great.
Can anybody explain this?
"hello, world.".scan(/\G(?:\w+|)/)
=> ["hello", "", "", "world", "", ""]
Cambiar atributos de imágenes en WordPress https://lineadecodigo.com/wordpress/cambiar-atributos-de-imagenes-en-wordpress/ por @victor_cuervo #wordpress #php #regexp #images #class
Un outil de remplacement de texte qui semble avoir une ergonomie un peu plus confortable que sed https://github.com/c0stya/trre #commandline #regexp #opensource
Just had to rename a bunch of files underscore-separated timestamps, and did a Python gist to facilitate this task to myself in the future.
https://gist.github.com/juandesant/16c337e15a87f430c3ab8483ffa0506d
The {rematch2} #RStats is a “small wrapper on regular expression matching functions regexpr and gregexpr to return the results in tidy data frames.” By @gaborcsardi . On CRAN.
https://github.com/r-lib/rematch2#readme
#RegExp #RegEx
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.
ECMAScript proposal: RegExp escaping
https://2ality.com/2025/01/regexp-escape.html
I’ve implemented RegExp.escape(). The result is more of an educational tool than something you should use in your code base (i.e., its main focus is readability): https://gist.github.com/rauschma/63b824c69a45900abbd09f7d12b895f4#file-regexp-escape-mjs
Another resource for regular expressions in R: A Shiny app by Adam Spannbauer
App: https://spannbaueradam.shinyapps.io/r_regex_tester/
Blog post: https://adamspannbauer.github.io/2018/01/16/r-regex-tester-shiny-app/
Need help with regular expressions in R? Check out the RegExplain RStudio add-in by @grrrck
https://www.garrickadenbuie.com/project/regexplain/
https://gugod.org/2024/11/regexp-digits/
如果你在用正規表示式的 \d 在驗證來自使用者的輸入的話,你得再想想。
#RegExp experts:
Is there a way to have a single regex and a single replacement string for a masking task like this w/o looping or multiple function calls?
johndoe@example.com
?????*+@?????*+.?+
johnd**@examp**.com
1. 1st n chars unmasked
2. Remaining chars until fixed chars masked
3. Fixed chars as is
4. 1st n chars unmasked
5. Remaining chars until fixed chars masked
6. Fixed chars as is
7. Remainder unmasked
These: #RegExp steht gar nicht für "Regular Expression" sondern für "Regierungs-Experimente".
The agrep() function in base R enables approximate string matching (fuzzy matching), useful for tasks like correcting misspellings and finding similar strings.
Its syntax includes parameters for the search pattern, target vector, maximum distance for matches, case sensitivity, and output format.
By default, it returns indices of matches, but setting `value = TRUE` returns the matched elements.
Post: https://www.spsanderson.com/steveondata/posts/2024-08-29/