TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What are your regex tricks?

5 点作者 Topgamer711 个月前

5 条评论

jjice11 个月前
I really liked Mastering Regular Expressions by Jeffrey Friedl. He goes in depth on what they are (with a bit of FSA background) and how a regex engine works. It helps conceptualize what&#x27;s going on and how to know what your specific regex library is doing.<p>Does that matter all that much? Not necessarily, but it&#x27;s good to know things like whether or not your regex can blow in time complexity due to back tracking or not.<p>Other than that, there&#x27;s a syntax overview that&#x27;s very strong, and the rest is pretty straight forward from there - just applying sequential pieces one after the other to build your pattern.<p>I also like those regex crosswords - those are some of my favorite puzzles to do. I wish there were more of them! <a href="https:&#x2F;&#x2F;regexcrossword.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;regexcrossword.com&#x2F;</a>
sandreas11 个月前
A cheatsheet, stackoverflow and <a href="https:&#x2F;&#x2F;regex101.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;regex101.com&#x2F;</a> - and of course a basic understanding of regular expressions in general.<p>If something gets too complex, I tend to write a Tokenizer &#x2F; Lexer these days. It&#x27;s not that hard.
评论 #40810895 未加载
cpach11 个月前
Perhaps I’m boring, but I generally prefer to keep them as simple as possible (^_^)
Naira_Nicol11 个月前
What is that?
评论 #40809873 未加载
评论 #40810697 未加载
solardev11 个月前
I used to spend a lot of time writing these by hand with reference pages and such. But these days ChatGpt is so good at coming up with them (and&#x2F;or debugging them) I just use that instead. It&#x27;s basically just another language it can easily translate to and from.