Micro.blog

matke
matke

I haven’t used Drafts for ages. The new custom syntaxes looks very interesting. Maybe I need to take another look.

In reply to
odd
odd

@matke My brain hurts when I see regex. Maybe I ought to learn more about it, so that I can unhurt. 🤔

Miraz
Miraz

@odd Regex is a wonderful thing and well worth spending a bit of time learning at least some basics.

odd
odd

@Miraz Yes, I see how knowing the basics really would be helpful for text manipulation, it’s just that I think it’s very hard to read, (to the untrained eye, at least).

PS: I’m wondering if I shouldn’t take the crossword puzzles tutorial too. But the class you signed up for was full, so I have to pick a later one.

Miraz
Miraz

@odd It is hard to read, but just like with reading books, you don't start with the 800 page densely written novels, you start with the ABCs. A tiny bit of Regular Expressions can go a long way.

Miraz
Miraz

@odd This is specially for you! miraz.me/2021/03/2...

odd
odd

@Miraz Yes, thanks! 😊 I just skimmed through it. My head is in hibernation just now, so I think I’ll look closer at it tomorrow.

Miraz
Miraz

@odd 😀 My only worry is that some Grep expert will jump in and say: “Of course you could do all that with this more elegant [much more complex pattern]!" But explanation rather than elegance was my goal.

crossingthethreshold
crossingthethreshold

@Miraz That's what I tell myself, spend some time learning regex, and then I look the other way...or find another way to find a solution. I just know the satisfaction that I feel when I make just a little progress.

Miraz
Miraz

@crossingthethreshold My intro will only take 5 minutes or less to read. 😀 Take a look.

crossingthethreshold
crossingthethreshold

@Miraz I’ve bookmarked it.

crossingthethreshold
crossingthethreshold

@Miraz That was very helpful. Thank you. I am going to save it for future reference. Like you I have BBEdit, and see that it has a very comprehensive Help section on grep. Taking a deep breath and diving in!

Miraz
Miraz

@crossingthethreshold Ah yes, BBEdit uses slightly different things — eg find ([a-z]+) and replace with \1 but the user manual is extremely helpful. Also, under the Search menu be sure to choose Pattern Playground which will show the results live without implementing them.

crossingthethreshold
crossingthethreshold

@Miraz Pattern Playground sounds like something I should use. I can imagine me making one or two mistakes as I figure this out. But thank you for the kick start!

Miraz
Miraz

@crossingthethreshold 🤣 “One or two mistakes”. If you do that you'll be a genius! Always work on a copy — I learned the hard way. I’ve made so many mistakes! It's easy to accidentally replace the whole document with something, instead of just the bits you meant to replace.

crossingthethreshold
crossingthethreshold

@Miraz Noted! 📝

odd
odd

@Miraz Yes, there is always those who would optimize by making the code almost illegible to other people. The more code reads like plain English, the easier it is to maintain.