mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#regexp

1 post1 participant0 posts today

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

#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

I've published a quick Vim tip today!

s0ands0.github.io/vim/regexp-m

## 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)')
```

S0AndS0 · RegExp match programming case conventionsTLDR echo matchstrlist(['userId'], '\v(\u+\l*)|(\l+)|(\d+)|(\D|\A)')
#code#foss#linux

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: spsanderson.com/steveondata/po

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: spsanderson.com/steveondata/po