#TFW #regexp в 6 строчек, написанный #ChatGPT, парсит #Markdown более лучше ①, чем тысячи строк #Redcarpet ② под капотом у #GlitchSoc
#TFW #regexp в 6 строчек, написанный #ChatGPT, парсит #Markdown более лучше ①, чем тысячи строк #Redcarpet ② под капотом у #GlitchSoc
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 在驗證來自使用者的輸入的話,你得再想想。
https://www.youtube.com/watch?v=5vbk0TwkokM
It seemed that Matt Parker has found Abigal's regex prime tester (or at least a variant of it.)
#RegExp experts:
Is there a way to have a single regex and a single replacement 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. Remaining chars unmasked
A website to write, test, and share regular expressions!
(I think this is pretty well-known, actually...)I've published a quick Vim tip today!
https://s0ands0.github.io/vim/regexp-match-programming-case-conventions/
## TLDR
- Spellcheck for camel case word components
```vim
:set spelloptions+=camel
```
- Match camel-case components of words
```vim
:echo matchstrlist([ expand('<cWORD>') ], '\v(\u+\l*)|(\l+)|(\d+)|(\D|\A)')
```
Ragazz'! Sto combattendo da qualche giorno con uno script awk cui sto lavorando per convertire i terribili estratti conto che mi fornisce la banca (in PDF, cazzo!) in CSV molto più manipolabili. La regExp che ho scritto, testata su regex101, funziona, ma nello script awk invece da problemi. Sapete mica se c'è un modo per debuggare gli script awk in modo semplice? Magari con una GUI o una TUI?
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/
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/