Yeah, no, I won't be doing this one. Maybe another transcriber is mad enough, but I can't find sources for several of the characters here, and this won't be fun.
I enjoy typing big long things so long as I'm actually typing most of the time and not just dragging over characters and copypasting them here and there. I can't motivate myself to do this.
Just FYI, using triple backticks for a code block makes it unreadable on Old Reddit if it's long enough (the line just stretches off the page) and not render as a code block on many mobile clients. A much better method is to add four spaces before each line of code; that will add a scrollbar for Old and render correctly for mobile =)
Well, you're the one who posted it, what do you think? The question isn't about reading, it's about seeing.
My main reason for transcribing code posts isn't for screen readers, as I seriously doubt anyone would listen to something like this. It's for people who can't see the image because their client or some other technological limitation means they can't load it, and therefore they can only experience the horror of the regex second-hand through other peoples' reactions, rather than through seeing the original image that prompted those reactions.
By transcribing the regex, they get the same ability to see, even if they don't read it in detail, the scale and nature of the regex, and thus have the same experience as someone who looked at the image. But if only the beginning of the regex is visible, that doesn't grant that accessibility. Those using Old Reddit or mobile clients still can't see it properly to get the same experience if the code blocks don't work -- the Old Reddit users are most affected here, as they can only see a tiny portion of the whole regex and so don't get the same context of scale.
And why's it such a bother to replace the triple backticks with four spaces? It's only one line. :P
The way it's rendering for me on mobile, I don't think it is only one line.
I can see the image, but that might not be true for everyone on mobile or might not still be true in 6 months or two years. The pasted regex comment looks (but may not necessarily actually be) like there are newline characters after every line because it renders on my display as shorter than full lines every third line in a regular pattern.
If OP is pasting this from an IDE or similar robust text editor, it should still be pretty easy (one menu button or one or two keyboard shortcuts) to add four spaces to the beginning of every line.
That would probably be because it's changed. Looking at the source with RES, OP has removed the end backticks. I do, however (on Old) still see a couple of random single-line code blocks in the middle, and half of it is italics - probably there are asterisks in there that are formatting now they're not in a code block.
It displaying on a single line might have been another glitch with the triple backticks code block, I'm not sure. Either way, it's even more broken now on Old than it was before.
Never mind, I just listened to the regex part on ttstool.com, it is god awful. If your gonna use the tool, go with Microsoft since Amazon tts just take decades.
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/_iamv, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
These judgements you (and others) make, they don't make sense. Are you actually reading and comparing the original image with this text? Do you actually know if it's accurate at all? Or are you just noting that this is also a wall of text and congratulating a commenter (who you may or may not have misunderstood as being a human transcriptionist).
Markdown is having a hard time too. Consider surrounding the whole thing with triple backticks (`) or prefixing each line with four or more spaces. Either of these (though the above transcriptionist seems to have good reasons to prefer the latter) will make the whole thing render in a monospaced code block.
Trying to scrape digraphs from arbitrary text? This is actually a reasonable solution. Very likely the regex is actually machine-generated from a human-readable list, and machine-generated code is always going to look like it was written by an insane person.
The negative lookahead makes sure no character repeats anywhere. M in the positive lookahead means we need to start with M. Then we need 255 characters where every step is the start of a listed digraph. Add Ň and we reach the end of the string.
I wonder if this is some obscure state machine validation where each digraph is an allowed transition between states. M is the starting state and Ň is the final state.
the state machine is a good guess... I would also go with the idea of fixing broken text encodings, but I'm not sure that makes sense...
Meanwhile, theorists do like to play with the equivalence between finite automata and regular expressions... but there are serious limits to this as described in this paper:
The fact that the screenshot shows "In [6]:" makes me think this is a Jupyter notebook or some-such that is exploring this kind of a equivalence by generating regex from some finite state machine representation and not actually regex that would ever be used in a production sense.
You'll likely crash it with the above regex, but there is a cool simulator that let's you see a back and forth of FSM with regex and run the automaton:
I don’t understand how this is reasonable at all. It looks like regex is being abused to do a lookup table transcoding. Is the goal to remove invalid digraphs by matching valid ones?
A handwritten stream parser plus lookup would not only be far more efficient than regex in this case, it would be much more readable.
Machine generating the regex is at least as complicated as writing the parser, or am I missing something here?
Very likely the regex is actually machine-generated
Maybe, if they manually copied and pasted the machine generated string into jupyter notebook. The "In" denotes a code cell that someone usually entered into the browser manually.
as a friendly reminder, dont regex match on a base64 string. Took JS several minutes to do so on an encoded image, and the users thought the app broke.
To display the image asap for the user and exchange it later with an URL, when it was uploaded to the server. Upload can take several seconds, showing the image with base64 nearly instant.
TBF ancient hieroglyphics created by an unknown civilization extinct for thousands of years are WAY easier to decode than a 200-char regex written by a programmer who left the company 3 years ago..
Yeah regex is sofrustrating, it's relatively easy to get you a text and write a string that matces everything you need, but goddamn if you ever need to read that again it never works how you think it does
So being serious for a minute do people actually do this?
I’ve never had to write a regex that long. If I find I need something like that I would try splitting strings, searching for text in strings, breaking strings into smaller pieces, accessing strings by indexes, smaller regex etc. There’s just so many techniques to avoid regex. I don’t think I’ve ever written a regex over 20 characters long that I’ve put into production.
I'm joking. I know why it's called regular -- I've been developing software since 1978. I still find it humorous that something that looks so cryptic and alien is called regular.
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/Alphatism, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
583
u/hellcat1301 Jul 07 '21
Hey code transcriber person, you haven’t done it yet, but when you do you have my respect. This post is a nightmare
138
u/meAndTheDuck Jul 07 '21
I bet if you change the width of the console to the right size you would get some hidden ASCII-art easteregg
184
u/[deleted] Jul 07 '21
Trying to scrape digraphs from arbitrary text? This is actually a reasonable solution. Very likely the regex is actually machine-generated from a human-readable list, and machine-generated code is always going to look like it was written by an insane person.
41
u/drdrero Jul 07 '21
as a friendly reminder, dont regex match on a base64 string. Took JS several minutes to do so on an encoded image, and the users thought the app broke.
73
u/misterrandom1 Jul 07 '21
I imagine someone from the future will find what they believe to be hieroglyphics etched on a cave wall. Then they realize it was only simple regex.
48
u/[deleted] Jul 07 '21
where is good human?
17
u/RyanNerd shameless Jul 07 '21
Once again we all ask how can anything that looks like this be called regular?
8
u/thanatica Jul 07 '21
I always found regexes to be borderline "write once, rewrite many" but this is stretching it 😀
6
u/CaydendW Jul 07 '21
I mean, this is what normal regex looks like IMO
5
u/the_vikm Jul 07 '21
That's really not that complex. Just a join of a long list of chars
8
u/[deleted] Jul 07 '21
This is the way
4
u/higgshmozon Jul 07 '21
Bahahahhaha wtf
4
u/Ledikari Jul 07 '21
Ohh secret of the scrolls, what knowledge you bestow upon thee
4
u/phi_rus Jul 07 '21
Not gonna lie, I kinda want this printed as a poster for my office
4
u/Needleroozer Jul 07 '21
"I believe regex is Turing complete and I intend to prove it."
3
u/[deleted] Jul 07 '21
Can someone explain me what the hell is going on here? What were they trying to achieve? Novice coder here!
2
u/[deleted] Jul 07 '21
can someone explain what's this?
2
u/Glori4n Jul 07 '21
Dear lord.
2
u/atti84it Jul 07 '21
What is the regex for?
1
u/KenaDra Jul 07 '21
Regex is dark magic, but incredibly useful. This is a diabolical curse. I shall add it to my grimoire's appendix section lol.
1
u/JustThingsAboutStuff Jul 27 '21
Someone's trying to make an email regex again.
0
u/[deleted] Jul 07 '21
[deleted] — view deleted comment