Anyone know #regex? How do I do a simple match of two words, like this AND that?
Reason number 327 you know you love your job:
Volunteering (insisting) to code an emergency workaround fix for your prod ecom website at 11pm on a Friday night, whilst on vacation with your laptop tethered to your phone.
And having a LOT of fun doing so (#regex, #Fastly VCL, Fastly Fiddle, ftw)!
#Regex က တကယ်ကိုခေါင်းစားချက်ပဲ 🙃
global flag နဲ့ logical OR ပေါင်းသုံးပြီး လုပ်တဲ့အကွက်တွေကို မပိုင်သေးဘူး။
I'd like much better #search #functions in my #SMS apps rather than syncing it to my #IMAP server and using Thunderbird (meh) or Perl / #RegEx from #BASH to find something important from a non-regular sender six months ago that is suddenly necessary again.
#Bash #regex #imap #sms #functions #search
#DailyBloggingChallenge (36/50)
#TIL that parsing #RegEx via sed
and pattern matching two different syntax variants are in use. The former requires a lot of escape character where as the latter doesn’t.
Take for example
\([0-9]\{2\}\-\)\+\([0-9]\{2\}\)
which is the correct syntax when using sed
, where as it won’t work with pattern matching over =~
. In such a case it would be
([0-9]{2}-)+([0-9]{2})
This cost me so much debugging fun.
#DailyBloggingChallenge #regex #bash #til
@wutti
Oha, da kann ich nicht ganz mithalten.
Mein #pizero blockt aktuell 4,63 Mio.
plus 30 Regex-Filter.
#pizero #pihole #regex #blockliste #axelspringer
New article online, about #regex in #spreadsheet : https://hublem.aws.afola.ovh/mainframe/news/116/
A couple of other #emacs things you can combine together with the ideas above:
1. Narrowing the buffer to only the portion of interest (or element, subtree, etc.). This is so good. It clears space and visual clutter, it ensures unwanted things don't get changed out of your view. I have also used it when presenting something in class; I didn't want the whole buffer to use up space, so I narrowed to the relevant part, allowing me to direct attention, increase font size and other nice things.
2. Swapping the keybindings for isearch with #regex and without regex. So my default search uses regexp. For most cases, you may not even notice the difference since you would be using alphanumeric characters in your search term. The only time it genuinely affects me is when I search for a `.` in the text and I have to escape it so that it searches for a literal `.` and not a wildcard match. But that is a small enough case that I can ignore that.
Another #emacs editing discovery. Every time my thought process goes along the lines of: "I can also do this!?!!"
Today's cast: #occur, #regex isearch, wgrep, and optionally keyboard macros, iedit and wdired.
(h/t This thread: https://emacs.ch/@ramin_hal9001/110933437057616428.
@ramin_hal9001 and @cwebber were mentioning many cools emacs tips and I learnt that I can *edit* what comes out of occur!)
TIL that you can switch from isearch to occur mid search! So you can do something like:
1. Start incremental (regexp) search in an editable buffer.
2. Once satisfied with the regex/search term, Do `M-s o` to have all matching lines end up in an occur buffer.
3. Press `e` to enable wgrep giving you an editable buffer with only matching lines.
4. Do whatever editing you like: iedit, regex replace, keyboard macros, whatever.
5. `C-c C-c` when done and the changes get reflected in *original buffer*.
Triggering occur after incremental search gets you the best of both worlds: the visual feedback on the regexp search helping to interactively adjust it. You jump to occur only when you're satisfied with the matches. It will be as if you had magically typed out that complex regexp free-hand.
I could agree with you, but then we'd both be wrong. 🤣
https://fosstodon.org/@dHeinemann/110909998916418762
Just kidding, thanks for responding, everyone! I had no idea "reg-ex" was so common.
#regex #regularexpressions #programming
I'm generally of the stance that #regex isn't nearly as bad as people say, to read or to write; especially if using something like #Python's re.VERBOSE. But holy cow is it easy to accidentally write an expression that does surprising things with look-behind/look-ahead. re2 and #GoLang not supporting those is a good call, IMO.
Explaining new functionality added to my random-table.el package. This explanation includes the Emacs Lisp code and some explanation. Ultimately, building these random tables grows my personal GM notebook; encoding logic and making it readily and consistently available (when I have my computer).
#regex #ttrpg #rpg #osr #emacs
Developers: how do you personally pronounce "regex"?
* Rej-ex ("Rej" as in "register")?
* Reg-ex ("Reg" as in "regular")?
* Something different? - share in the comments!
#regex #regularexpressions #programming
Protip: if you want to validate international text, never use [A-Za-z] in your regexs. Use \p{L} (unicode letter), \p{Lu} (uppercase unicode), \p{Ll} (lowercase unicode).
https://ruby-doc.org/3.2.2/Regexp.html#class-Regexp-label-Character+Properties
#ruby #regex
I feel like I need a badge for this. While writing an ugly pile of #regex to deal with one problem, I accidentally implemented a feature that hadn’t even been through design, much less scheduled in a sprint. Know barely more #ruby than 2 days ago (a *lot* more about gsub()’s matching quirks, though), but it ships to production Monday.
Ich habe gestern hier ein Comic gesehen, wie man "richtig" #regex macht (eine Katze über die Tastatur laufen lassen), aber ich habe es anscheinend doch nicht gesternt und jetzt finde ich es nicht mehr ... hat es sonst jemand gesehen? #FollowerPower
Elixirでマークダウンからfront matterを抽出する
https://qiita.com/mnishiguchi/items/5a969a821d9ad32b940b?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
#qiita #Markdown #Elixir #YAML #regex #frontmatter
#qiita #markdown #elixir #yaml #regex #frontmatter