leobm, to RegEx German
@leobm@norden.social avatar

The ?x modifier/flag is nice, never used it before.
Makes it possible to include commentary inside complicated patterns. #perl #regex

original source: https://polar.sh/eval/posts/named-capturing-groups-in-clojure
#clojure

evilchili, to Canada
@evilchili@linernotes.club avatar

Hey Canadian nerds! I have held the domain registration for regex.ca for a very long time. When I lived in Canada it was my primary domain, but I haven't used it for years. Does anyone on the fediverse have a good use for it?

I'm going to release it but if you've got a good pitch I'll pay for a 1 year renewal and then transfer it to your ownership.

Please boost for visibility kthx!

claudius,
@claudius@darmstadt.social avatar
piko,
@piko@chaos.social avatar

@claudius has a nice idea, but I think https://regexle.ithea.de/ doesn't have enough Canada relations for that to really make sense. But thanks!

@evilchili @blinry

chrastecky, to RegEx
@chrastecky@phpc.social avatar

Lo and behold, fellow mortals of the programmer variety! I find myself embarking upon a most arduous quest.

One that shall test the mettle of my coding prowess... Yes, thee heard right.

I dare to dance with the elusive and powerful entity known as... the #regex #email #validation!

heiglandreas,
@heiglandreas@phpc.social avatar

@chrastecky All right! 3 step email verification:

  1. No '@', no email address
  2. No MX entry in DNS for the part *after" the '@', no email address
  3. No response to a link in an email to the email address, No email address.

Everything else might look like an email address, but it isn't.... 🤷

heiglandreas,
@heiglandreas@phpc.social avatar

@chrastecky And while

ändi@stella.maris.solutions

looks like a valid email-address (if it doesn't, check your algo) ir is about as valid as "hello world" as an email address.

But that might just be different expectations of what a valid email address is. 🤷

When your customer is happy with above string being considered a "valid email address", then everything is fine...

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

If you work with text data in R, the gregexpr() function is essential for pattern matching. It finds all occurrences of a pattern within a string. Key parameters include pattern, text, ignore.case, perl, fixed, and useBytes. You can match characters, ignore case, use advanced regex, and search fixed strings.

#R #RProgramming #Programming #RStats #ROpenSci #Text #regex

Post: https://www.spsanderson.com/steveondata/posts/2024-05-17/

image/png
image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🎉 New Post Alert! 🎉

Counting words in a string is a fundamental task in data analysis.

  1. Base R: Use strsplit(), a straightforward method to split strings and count words.

  2. stringr: The str_split() function from the stringr package makes the code more readable.

  3. stringi: For powerful and efficient string manipulation, stri_split_regex() from the stringi package is your go-to.

Happy coding! 🚀

#R

Post: https://www.spsanderson.com/steveondata/posts/2024-05-16/

damien_dupre,

@stevensanderson what about stringr::str_count(x, "\\w+")?

stevensanderson,
@stevensanderson@mstdn.social avatar

@damien_dupre yes that works too

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🔎 Selecting Columns Containing a Specific String in R: A Quick Guide 🚀

Hey R users! Need to select columns by a specific string? Here's how in base R, stringr, stringi, dplyr, and with a bonus from data.table.

🆒 R
✅ grepl
📦 stringr
📦 stringi
📦 dplyr

Bonus: 📦 data.table
library(data.table)
df_price <- df[, names(df) %like% "price"]

Happy coding! 🚀

Post: https://www.spsanderson.com/steveondata/posts/2024-05-15/

#R #RProgramming #Programming #RStats #Coding #RegularExpressions #RegEx #stringr #stringi #dplyr #datatable #baseR

image/png
image/png
image/png

lizardbill, to RegEx
@lizardbill@hachyderm.io avatar

You can't parse [X]HTML with regex. #regex #html https://stackoverflow.com/a/1732454/1288

SirTapTap,
@SirTapTap@mastodon.social avatar
stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🔍 Quick Guide: Detecting Strings in R

In my latest blog post, I cover how to find specific strings in data columns using the str_detect function from the stringr package and base R functions. You'll see practical examples with both grepl for identifying matches and gregexpr for counting occurrences.

Read more here: https://www.spsanderson.com/steveondata/posts/2024-05-10/ and explore ways to make string detection a breeze in your data work!

#R

image/png

donwatkins, to RegEx
@donwatkins@fosstodon.org avatar

Regular Expressions #2: An example – Both.org https://www.both.org/?p=5154 #regex #Linux

stevensanderson, to stackoverflow
@stevensanderson@mstdn.social avatar

I was working on a problem today where I needed to pick out a department and a sub issue that were attached to each other as a single code in a comment.

I first went to use the traditional SUSTRING(comment_string, 1, 5) IN (my list of codes) but it was slow.

So off to work, I learned something new via and learned to make a sarge-able LIKE with what ever I want in the narrower results.

Nice to learn something new.

villetakanen, to RegEx
profoundlynerdy, to raku
@profoundlynerdy@bitbang.social avatar

What are some underappreciated superpowers that and/or has EXCLUDING and ?

NireBryce, to RegEx
@NireBryce@hachyderm.io avatar

does there yet exist any application that can take a multi-selection and spit out a #regex that will match that in any file going forward?

stevensanderson, to RegEx
@stevensanderson@mstdn.social avatar

I decided to make a blog post out of a problem I worked on a day or two ago and thankfully I was also pointed to another solution from @embiggenData which worked well too.

#R #RStats #RProgramming #Data #regex #tidyverse #glue #unglue #tidyr #dplyr

Post: https://www.spsanderson.com/steveondata/posts/2024-04-12/

image/png
image/png

necrosis, to RegEx German
@necrosis@chaos.social avatar

Liebe Informatik Lehrkräfte, bitte bringt euren Schülerinnen und Schülern #RegEx bei.

Es hilft im Job ungemein. 😅
Ich wünschte ich hätte das schon in der Schule gelernt. 🥹

#FediLZ

Linkshaender,
@Linkshaender@bildung.social avatar

@hobbypaedagoge ich grätsche mal rein 😉
Suchen (und Ersetzen) von Text
Parsen von Logfiles
Validieren von Daten/Eingaben (nein, keine Mailadressen!)
Daten bereinigen
Extrahieren von Infos aus Textdateien

Anwendungstipp: awk lernen.

Informatik-Unterricht: Automatentheorie, formale Sprachen, Parsing

Regex sind ein scharfes Schwert, wie dieses sollte der Umgang geübt werden (s XKCD-Cartoon)
@necrosis

mina,
@mina@berlin.social avatar

@Linkshaender

See me whilst presenting common command line tools to Windows users:

@hobbypaedagoge @necrosis

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines