Earlier quoted context omitted.
It very much depends what the use case is. I find that a lot of the text processing I do is easier to use back references or other regexy things. Having said this, I use tools that make regexes easy to use and readily available - I think in many programming languages the syntax means that other solutions are just as easy to devise and implement.
If you are a solo dev, you do you, but if you are working in a team and you are building huge regexes with back references and other bells and whistles... I would guess it's not very readable for your teammates. At least for me, when I look at such a regex I have to stare at it for minutes before grokking it.
Learn RegEx step by step, from zero to advanced
81–90 of 114 posts
Re: Learn RegEx step by step, from zero to advanced
#82Earlier quoted context omitted.
It very much depends what the use case is. I find that a lot of the text processing I do is easier to use back references or other regexy things. Having said this, I use tools that make regexes easy to use and readily available - I think in many programming languages the syntax means that other solutions are just as easy to devise and implement.
If you are a solo dev, you do you, but if you are working in a team and you are building huge regexes with back references and other bells and whistles... I would guess it's not very readable for your teammates. At least for me, when I look at such a regex I have to stare at it for minutes before grokking it.
Re: Learn RegEx step by step, from zero to advanced
#83> The basic matcher is to type as is to choose a character or word. For example, to select the word curious in the text, type in the same way.
Re: Learn RegEx step by step, from zero to advanced
#84Earlier quoted context omitted.
> I always look at these intros/descriptions of Regex with a heavy heart. They describe what regex's are, but none of the info is going to make much sense to someone who doesn't already know why they would want to learn them. > Catch 22 of trying to explain what they are. any teachers, or people who explain/document things for a living, have some good tips or templates to avoid this?
Yeah. 1) Encourage whoever you're teaching to stop you immediately if they don't feel like they understand something you're saying, even if it's a single word that's throwing them off, and especially if they're not rock-solid about a simple concept they "should already know". Modern school teaches people that "returning to the basics" is a waste of time; but as Feynman says, you should return to the basics often, as…
Re: Learn RegEx step by step, from zero to advanced
#85>Regular Expressions, abbreviated as RegEx or RegExp, are a string of characters created within the framework of RegEx syntax rules. You can easily manage your data with RegEx, which uses commands like finding, matching, and editing. Regex can be used in programming languages such as Phyton, SQL, Javascript, R, Google Analytics, Google Data Studio, and throughout the coding process. Learn regex online with examples a…
I think regex is absolutely terrible garbage. It’s very powerful, I do appreciate not having to write complex conditional statements, and it’s great that it’s available is so many languages and applications. But it’s just a bad tool, terribly unreadable, easy to introduce bugs, with lots of trial and error. It has too much brevity and would be much better if it were longer but more human readable. I’m sure there are…
Re: Learn RegEx step by step, from zero to advanced
#86My problem with it (other than all the different flavors—that’s just history’s fault) is that you don’t tend to get integrated help/tool support for them. They are often just plain strings—how is e.g. Intellij supposed to spot them reliably and help you?
It’s too bad if we have to copy and paste regex strings into websites in order to figure out what they do.
The number one most useful tool support in my book would just be to highlight metacharacters. Are parens a metacharacter in the dialect that I am using now? Is `+` significant?
A bigger ask would be more verbose regular expression declarations and compilers that can translate to and from them. It’s nice if you can use comments in a regex dialect, but comments should be treated like they are treated in code writ large; don’t use them if you can make the code “self-describing”. Imagine a more verbose declaration language where you can make local aliases, for example `let ident = [a-z][a-z1-9_]*`.
Re: Learn RegEx step by step, from zero to advanced
#87Re: Learn RegEx step by step, from zero to advanced
#88I respect regex for being a widespread DSL that makes certain things very declarative. My problem with it (other than all the different flavors—that’s just history’s fault) is that you don’t tend to get integrated help/tool support for them. They are often just plain strings—how is e.g. Intellij supposed to spot them reliably and help you? It’s too bad if we have to copy and paste regex strings into websites in order…
However, I would realllyyy not want to have a more verbose regex dialect. For me at least, it would make recognizing common regex patterns a lot harder since they won't be succinct. It would also be yet _another_ regex variety that I would have to remember.
For me, Perl's DEFINE feature and 'x' switch are definitely close enough[1] to variables and comments. Pardon, I don't remember what they are officially called. What we really need is for more non PCRE engines to implement these features
Re: Learn RegEx step by step, from zero to advanced
#89One day at my second job out of college, I wrote a quick regex for something, and one of my more senior colleagues looked at me like I was a wizard. It was amazing to be able to get some street cred for that. To me, it validated the effort I went through previously.
I'm trying to learn about SAT/SMT solvers now. Not because I have a pressing need for them but because it's a completely foreign thing that - who knows? - maybe I'll be able to put to good use today. The problem with SAT/SMT is that there are nowhere near the clear learning resources compared with, say, regexes.
Re: Learn RegEx step by step, from zero to advanced
#90I respect regex for being a widespread DSL that makes certain things very declarative. My problem with it (other than all the different flavors—that’s just history’s fault) is that you don’t tend to get integrated help/tool support for them. They are often just plain strings—how is e.g. Intellij supposed to spot them reliably and help you? It’s too bad if we have to copy and paste regex strings into websites in order…
https://discourse.julialang.org/t/ann-readableregex-jl/43450