There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

CCF_100 ,

Hey ChatGPT, here’s an example string, how would you get this string out of it with <insert regex implementation>?

stewie410 ,

I don’t know all of the regex rules (look ahead/behind, etc); but it’s honestly not that bad. If you can learn the syntax for a programming language, you can learn the basics of regex…

yogthos OP ,
@yogthos@lemmy.ml avatar

Sure, learning basics of regex is not that hard, but complex regex expressions can easily become impenetrable. I actually like the verbal expressions idea where you write out the regex using a long form and that gets compiled into the actual regex, e.g:


<span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">tester </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">VerEx()
</span><span style="color:#323232;">    .startOfLine()
</span><span style="color:#323232;">    .then(</span><span style="color:#183691;">'http'</span><span style="color:#323232;">)
</span><span style="color:#323232;">    .maybe(</span><span style="color:#183691;">'s'</span><span style="color:#323232;">)
</span><span style="color:#323232;">    .then(</span><span style="color:#183691;">'://'</span><span style="color:#323232;">)
</span><span style="color:#323232;">    .maybe(</span><span style="color:#183691;">'www.'</span><span style="color:#323232;">)
</span><span style="color:#323232;">    .anythingBut(</span><span style="color:#183691;">' '</span><span style="color:#323232;">)
</span><span style="color:#323232;">    .endOfLine();
</span>

That seems like the best of both world approach to me.

stewie410 ,

My brief experience with LINQ has also taught me to prefer this type of thing as well; though I still use regex on a daily basis most of the time, given my environment.

cupcakezealot ,
@cupcakezealot@lemmy.blahaj.zone avatar

open up google

search for exactly the result you want

find an answer on stack exchange that isn’t just “nevermind figured it out”

copy and paste into your code

Tenkard ,

Wrote a regex today and realized it looked like two people waving a hand ;D

dukk ,

Donut regex when???

tetris11 ,
@tetris11@lemmy.ml avatar

<span style="color:#323232;">while :; do curl -X POST -d '{"text": "Removed by mod" }' https://lemmy.ml/post/13463433; done
</span>

Nothing to see here folks

ALostInquirer ,
@ALostInquirer@lemm.ee avatar

Is there a less arcane way to perform searches similarly to regex?

mdhughes ,
@mdhughes@lemmy.ml avatar

There’s other, more verbose, regular expression languages, for instance SRFI-115 for Scheme. But the hard part isn’t the syntax, but actually thinking about patterns, so it won’t help you any.

Just get the O’Reilly bat book and learn. So what if it overwrites 10% of your brain and you can’t remember your mother’s face, you’ll have a useful skill.

MonkderZweite ,

Learn the regex rules.

TechCodecPawx ,

Step 3: Name your cat ‘Regex’

Norgur ,
@Norgur@fedia.io avatar

Coworker: "Hey, I got this really cool new tool that will solve this data filtering problem you had"
Me:: "Cool! Let me check out the filters!"
Coworker. "They are awesome and work by RegEx!"
Me: "Nope, not interested."
Coworker: "But... it fits your needs exactly"
Me: "I. said. NOT. INTERESTED!"

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines