[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is regex so dumb, gay, and bad?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 54
Thread images: 4

File: regex-example.png (35KB, 931x346px) Image search: [Google]
regex-example.png
35KB, 931x346px
Why is regex so dumb, gay, and bad?
>>
>>56365757
How retarded do you have to be to not be able to understand regex?
>>
I fucking love writing long and complicated regexps. Am I weird?
>>
>>56365827
Regex isn't obvious at all. I know it makes you feel smart by pretending it's super easy, but it's not.

Answering your question OP, it's great. If you disagree please make your own pattern standard.
>>
File: huge regex.png (162KB, 579x1733px) Image search: [Google]
huge regex.png
162KB, 579x1733px
>>
>>56365757
instead of complaining, how about you come up with a simple and easy regex syntax?
thought about it for a minute?
>>
its not intuitive but once you get the hang of it its very cool and useful, you'll want to use it everywhere
what sucks is everyone and their mother has a variation on regex
>>
>>56365909
I have used it at work without knowing how it works but being able to funble through it. I just watched a youtube tutorial and now realize its not even hard or confusing after having someone explain how it work.

How do i delet this thread
>>
>>56365861
no mate there is nothing better than writing a complex as fuck regex and have it work on first try , I dont know why people hate it so much once you know how to use it its useful as fuck for managing your own plain text data structures , command line interfaces , data mining web pages and such.
>>
>>56365757
>Why is regex so dumb, gay, and bad?

This says more about OP than it does about regex
>>
>>56366105
Yep , OP basically described himself.
>>
>>56366077
Generally speaking, if you're using regex, its probably not the best way of doing whatever you're doing.
>>
>>56366213
No, you're just too retarded to know how to read them.
>>
>>56366213
obviously , but its still cool using regex tester to write the entire line , stick in your input and watch everything you want suddenly highlight like magic if you did it right.
>>
>>56365757
Don't worry OP. People make bloated pieces of shit that reduce to regex but are simple enough to be processed by your tiny brain
>>
>>56365757
because you're a stupid faggot who's unwilling to learn
>>
regex is fun and good and cool

but often not the appropriate tool for the job, sadly
>>
>>56365909
>Regex isn't obvious at all
No one said it was obvious, it's just easy. Yes you have to memorize some rules, but you had to do that when you learned to program as well. What on earth about it is hard? It's tremendously simpler than the system you're using to invoke a PCRE lib
>>
>>56365936
What is this for? I see an http in there, but that's about it.
>>
>>56365757
it looks weird at first, but once you understand its rules they become pretty clear
>>
>>56366546
Regex is so easy dude lol how can you not tell what that does lol
>>
Because regex isn't even a regular expression
>>
>>56367017
PCRE engines do not implement regular expressions but there are other implementations that truly constrained to regular expressions (that is they match only the regular languages, they generally hold to PCRE notation but that doesn't make them not regular expression matching libs). See go's regex library for example. I think boost regex too.
>>
the only problem i have with regex is how everything uses a different version of it.
>>
>>56367455
Yeah this is annoying as fuck. I can never remember what works or not with grep.
>>
>>56366546
it's probably some needlessly complex way to catch urls
>>
>>56367478
>>56367455
this

if it were standard, that would be nice, but vim, perl, python, and grep all use different regex

and then my work has a regex engine implemented in our webapp and it's different from all of the above somehow
>>
regex is nothing compared to xpath
>>
The real mistake is calling it regex in the first place.
Devising a ruleset for pattern matching amongst a regular language and calling it regex strongly implies that there is only one standard.
>>
>>56365757
If you fail at regex already, you should consider a career in gender studies or maybe pursue a liberal art degree.
>>
>>56367478
>Yeah this is annoying as fuck. I can never remember what works or not with grep.
>>56367589
>perl, python, and grep

Just use grep -P to get PCRE.
Python and Perl also use the PCRE standard.
>>
>>56368852
I think killing yourself is the best option here.
>>
>>56369037
>things I don't understand are "dumb, gay and bad" and everyone who DOES understand them should kill themselves
Are you 12?
>>
>>56369048
I meant those who consider gender studies.

do you have some repressed rage anon ?
>>
>>56369061
Gender Studies a simple enough subject for people who don't understand regular expressions. That is all.
>>
>>56365757

You clearly don't have a real world job.
You're also challenged by regex.
You are pathetic.
>>
>>56365757
>Why is regex so dumb, gay, and bad?
It takes one to know one.
>>
I use regex to rip info from a website, its really handy, if i did it by hand it would be impossible. 8000+ entries.
>>
>learn regex on linux
>GNU sed is different than BSD sed
>is different than perl's sed and python's sed
>is different from 4chan X's javascript regex

based regex
>>
It seems fine for such a powerful tool.
>>
>>56367589
> vim, perl, python, and grep all use different regex
how did this came to be?
>>
I\ fucking\ hate\ having\ to\ escape\ everything\ in\ regex\.
>>
>>56370290
You don't have to escape spaces in any regex variant that I know of.
>>
>>56365757
op.match(/cocks/g); // note the g makes it greedy
>>
>>56368872
>perl uses perl regex
ok
>>
>>56370366
>GNU uses GNU compiler collection
>>
>Why is [something I don't understand] so dumb, gay, and bad?
>>
File: grinch in a mask holding a gun.jpg (62KB, 900x900px) Image search: [Google]
grinch in a mask holding a gun.jpg
62KB, 900x900px
>ICANN adds another meme tld
>I have to update literally 14 regexes in all of my projects

REEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>56370435
Just match all possibly legal TLDs
>>
The problem with regex is that it can get hard to read and there is several different syntaxes.
I learned it though sed, but I have also used it a lot on JavaScript.
Those two are not identical.

If you don't like to document what you are doing stay away from it.
You figure out how to find a pattern and the next person might not be able to read it.
Miscommunication leads to mistakes.

Often you will have a problem and you think that regex might be the solution to it. Then you will find yourself having two problems.
>>
>>56370358
g means global meaning it won't stop after the first result.
Greedy would be to stop after the first match, eg if you have /match.*match/ then you might search from both ends of the document and stop too soon.
>>
>>56365757
I hate regex's syntax but damn I love using it
if you can't figure out regex, you shouldn't be here
>>
Re2 and the like are super effective as they protect programmers from overcomplicating them

Lookaheads are the real enemy
>>
>>56366283
what the fuck is this monstrosity, is it fucking ORM for regexps?

for real?

.literaly('why are people wasting their and our time?')
Thread posts: 54
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.