And I’m pretty sure the line about how many licks it takes to get to the center of a Tootsie Pop was mine. Prompted by Drang’s kind words, I just re-read the chapter for the first time in a few years, and it holds up. What I contributed to the Grep chapter was all the stuff in PCRE that BBEdit’s old regex engine didn’t support, which, admittedly, is a lot of stuff. (The manual is available in BBEdit’s Help menu.) The regex syntax it describes will work in just about every current programming language or text editor. If you’re regex-curious, I highly recommend that you start by reading that chapter - even if you’re not a BBEdit user. I went from “this stuff looks like gibberish” to “Oh, I get it, I see how this could be super useful” just by reading that chapter. In fact, like Drang, I learned regular expressions by reading BBEdit’s Grep chapter. The Grep chapter in BBEdit’s user manual was already very good when I started working at Bare Bones - the entire manual, cover-to-cover, has always been and remains genuinely excellent. I pushed for BBEdit to switch to Philip Hazel’s excellent PCRE (Perl Compatible Regular Expressions) library, which supports just about every advanced bit of regex syntax anyone could want - and it’s fast, supports Unicode, written in good clean cross-platform C, and more. If I recall correctly, it was a highly customized version of Henry Spencer’s classic library, which supported only the classic features of regular expression syntax. Long story short, until BBEdit 6.5, BBEdit used a rather basic regex engine. Written by a young guy named John Gruber.Īs for the Grep chapter in BBEdit’s user manual - I did write a significant part of it, but I can’t take and shouldn’t get credit for all of it. One I learned from over 20 years ago: the “Searching with Grep”Ĭhapter in the BBEdit User Manual. Mastering Regular Expressions for a reason, and that reason is notīecause it’s a tutorial. This is too bad, because while Friedl’s book is great, it’s called Topic and have a natural reaction when they see it: A 500+ pageīook to learn how to search for text? No thanks. Regular expressions often hear about this great book on the Instant visual feedback with undo support - I’ve worked with text this way since 1992.Įven worse, people who are thinking they should start using But even when I do write a script to automate some sort of text munging, it inevitably starts with me working out the regex transformations step-by-step in BBEdit. I’m only going to make a proper script if it’s something I know or suspect I’ll reuse. If the task at hand is something I only need to do once or twice, right now, it’s simply easier to just do it in BBEdit. What Drang describes above is my process too. Why use Excel for date transformations when scripting languages all have extensive date libraries? String together any number of individual munging steps.)Īfter I linked to Snell’s piece, a reader emailed to ask why I didn’t think this would’ve been better solved by writing a script in Perl/Python/Ruby or any other language with good regex support. Python or Ruby or whatever, BBEdit’s Text Factories allow you to But Im new to Grep, and BBedit - so, Im hoping someone here might be able to. (And if you expect to do a series of text transformations oftenĪnd really don’t want to get into writing scripts in Perl or items following the new item increment by one. Getting immediate feedback on each transformation step. Playing around in BBEdit to see what searches, replacements, and Just large-scale text editing or if I expect to be repeating the Typically resort to that only if the problem requires more than Drang, regarding Jason Snell’s tale of using BBEdit and Excel to create a working RSS feed for an old podcast, “ Don’t Fear the Regex”:Īlthough I do often write short programs for text munging, I It also supports similar integration with shell scripts and any other Unix scripting language.On Getting Started With Regular Expressions Friday, 11 January 2019ĭr. It’s also fully scriptable with Applescript, and works directly with the native Perl, Python, and Ruby environments provided by Mac OS X. Questions can be answered in BBEdit’s Help Book or the extensive manual (both available under the BBEdit Help menu), by sending email to (they answer all their emails!), and you can even get helpful pointers on Twitter at are some of the built-in text processing actions that BBEdit can do natively (many allow grep matching): In addition, dozens more languages are supported in Codeless Language Modules which are enumerated both on this site and on the official Bare Bones web site.īBEdit’s customer support is legendary. The languages BBEdit supports natively include: BBEdit is a text editor with lots of features that make it ideal for editing any sort of code, words, or even web pages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |