/prog/ - Programming

Anything related to programming and creating software.


Mark sensitive

File: idontunderstand.jpg (9.23 KB)
Anonymous 06/01/21(Tue)06:21:28 No. GL1XK382 [Report]

> ^n[a-z]+g+.*r$ is regex used anywhere other than in obsolete shell scripts?

Anonymous 06/01/21(Tue)06:38:05 No. Q7FAVW5P [Report] >>IYIK4NDO

no one i know that works in the industry uses regex. you print the string first and then split the string into array of words and count the index for the parts you want to match or grab. no bloated regex expressions. regex is boomer tier.

File izone.nigger.webm (2.93 MB)
Anonymous 06/02/21(Wed)06:29:48 No. 2KRNRY5L [Report]

Back in the day, people used to make fun of perl's regexps, but then everybody copied them. http://www.pcre.org/ Regexps are a very useful minilanguage for describing textual patterns. The regexp in the OP isn't even that exotic. It's just looking for variations of niggers. ^ - beginning of string n [a-z] - any letter between a-z + - one or more of them g + - one or more of the letter g .* - anything (including the null string) r $ - the end of the string

Anonymous 06/02/21(Wed)06:34:59 No. OF43SEEE [Report] >>PXS83TS8 >>5ANGA4MI

>>GL1XK382 (OP) Open up your browser console or a nodejs repl and type the following: /^n[a-z]+g+.*r$/.test('nigger')

Anonymous 06/02/21(Wed)06:58:42 No. PXS83TS8 [Report] >>UX939GDV >>44823KUW

>>OF43SEEE haha. Although regex may be powerfull, the syntax is very cryptic. Is there any other way to pattern match strings?

Anonymous 06/02/21(Wed)07:06:18 No. UX939GDV [Report] >>2E1QA6VA

>>PXS83TS8 You're not the first person to think this, and I'll admit that I had similar thoughts when I first saw regexps too. However, you try the other ways, and you eventually come back to regexps, because it just fucking works. It's a minilanguage for building state machines to match text patterns. There's a reason almost every language that came after Perl eventually incorporated Perl compatible regular expressions into their own language... and that's after they mercilessly tried to mock Perl for being illegible.

Anonymous 06/02/21(Wed)07:17:52 No. 2E1QA6VA [Report] >>F0E5GSJ2 >>KP5H5S02 >>0ITUVIIA

>>UX939GDV yeah, i dont see the point. if you can split it into an array and just get the index for the areas you want is less bloat. people who like regex are like people who use rust. they feel they are doing more by using cryptic shit. for loop, array index is all the pattern matching you need. I guess i can see the point if your trying to be a `power user`

Anonymous 06/02/21(Wed)07:40:09 No. F0E5GSJ2 [Report] >>8KH5BY1U

>>2E1QA6VA Suppose you split a string into an array of characters and parsed it the same way OP's regexp does. How much code would you have to write to accomplish the equivalent of: /^n[a-z]+g+.*r$/.test('nigger') I'm going to guess that pattern came from a profanity filter. Now think about how many "bad" words there are in this world and how many permutations of those words can be made to try to get around filters. Imagine having to implement a profanity filter without regexps.

Anonymous 06/02/21(Wed)07:44:08 No. KP5H5S02 [Report]

>>2E1QA6VA >people who like regex are like people who use rust Also, it's more widespread than you think. https://en.wikipedia.org/wiki/Comparison_of_regular-expression_engines

Anonymous 06/02/21(Wed)19:38:03 No. SW1YVLTD [Report]

>>GL1XK382 (OP) AdBlockers

Anonymous 06/13/21(Sun)09:41:35 No. 44823KUW [Report] >>0ITUVIIA >>0MMICB9X

>>PXS83TS8 Parser combinators! Basically the same idea as regex, but readable. Your code ends up looking like (using Parsec in Haskell): braces = between (symbol "{") (symbol "}") the combinators are very human readable (many, sepBy) and they're integrated with the Alternative typeclass, so you can program choice without resorting to ugly regex capture groups: myLang = someExp <|> someOtherExp <|> ...

Anonymous 06/13/21(Sun)14:06:24 No. 91F3X5S4 [Report]

>>GL1XK382 (OP) Regex is fantastic in the terminal, in text parsing, and in text/code editors. What sort of loser can't into regex?

Anonymous 06/13/21(Sun)14:08:29 No. 8KH5BY1U [Report]

>>GL1XK382 (OP) >>F0E5GSJ2 It's a bad regex for this. The .* is a DoS risk and doesnt make sense when you only want to match a few characters at most. Should be something like >^n\w{1,3}g+.{0,3}r$

Anonymous 06/13/21(Sun)14:26:59 No. 0ITUVIIA [Report] >>0MMICB9X

>>2E1QA6VA You appear not to know what you're talking about. Regex is a mainstay of unix/c/perl/shell style and culture and generally considered the opposite end of the spectrum to rust. Also, regex is hardly cryptic - you just don't know it. >>44823KUW This is interesting, although obviously doesn't replace regex in the terminal or editors. I can't imagine anything beating regex for live situations.

Anonymous 06/13/21(Sun)20:23:14 No. 0MMICB9X [Report]

>>0ITUVIIA This is -> >>44823KUW Agreed, for situations like terminal or a quick script, the ubiquity of regex in those situations (Perl support, terminal tools) makes them a better choice in many cases. Parsec is more heavy weight, and sometimes the benefits it gives (readability, type safety) aren't something that you particularly care about.

Anonymous 06/23/21(Wed)17:41:40 No. IYIK4NDO [Report]

>>Q7FAVW5P >no one i know that works in the industry uses regex Where the fuck do you work?

Anonymous 06/28/21(Mon)19:13:52 No. XYB1LEUZ [Report]

>>GL1XK382 (OP) perl, the greatest

Anonymous 08/20/21(Fri)19:30:46 No. 5ANGA4MI [Report]

>>OF43SEEE checked

Anonymous 10/14/21(Thu)21:31:48 No. fprog-YYP3IGVP [Report] >>2WV98TN8 >>1XM2P0BN

>>GL1XK382 (OP) That's a fucking stupid regex to use as a slur filter since it also matches 'nagger', as in, 'someone who nags'

Anonymous 10/14/21(Thu)22:36:53 No. fprog-OSIJW475 [Report]

>>GL1XK382 (OP) >he doesn't use S-regex ngmi

File 1613278135372.jpg (111.81 KB)
Anonymous 12/10/21(Fri)23:33:57 No. 2WV98TN8 [Report]

>>fprog-YYP3IGVP Naggers being filtered out counts as a fringe benefit.

Anonymous 12/15/21(Wed)06:45:00 No. 1XM2P0BN [Report] >>2NI42EQA

>>fprog-YYP3IGVP hows this? > ^[nN][1il][9gq]{2}ers? matches with: nigger niggers n1ggers nlggers ni99er niqqer anyway to make this better? (anymore creative ways of saying nigger)

Anonymous 12/15/21(Wed)06:46:31 No. 2NI42EQA [Report]

>>1XM2P0BN > n1qg3rs

File mc.png (5.96 KB)
Anonymous 12/18/21(Sat)13:45:16 No. Q0X525NY [Report]

OP a faggot. Everything remotely powerful has regex. Only niggerlicious software doesn't.

[Post a Reply] 23 / 3

[Home] [Rules] [FAQ]

All trademarks and copyrights on this page are owned by their respective parties.