On 01/03/2019, at 17:53, Dj <[email protected] <mailto:[email protected]>> wrote: > Couple more quick things: would it be hard to do one that only extracts text > that is within quotation marks?
Hey Dj, Straight-Quotes "[^"]+?" Smart-Quotes “[^”]+?” > I tried one off a github cheatsheet and in the past hours couldn't modify it > easy, but am making progress. Also, if you or anyone on here can suggest a > book on getting better at expressions and BBedit? See appended document. I haven't updated it in a while, but it's still relevant. > Maybe just piecing it together off stackoverflow and google etc is best > though? Thanks again Not just no but HELL no! 😎 You can definitely get help with things via this method, but you'll waste a lot of time when working for general education. You need: A good basic book. A good intermediate book. A RegEx recipe book. Tools like BBEdit <http://www.barebones.com/products/bbedit/>, Patterns <https://itunes.apple.com/us/app/patterns-the-regex-app/id429449079?mt=12> and/or RegExRX <https://itunes.apple.com/us/app/regexrx/id498370702?mt=12>. An online RegEx analyzer like RegEx101.com <https://regex101.com/> Mentoring. Lots of practice. Very basic regular expressions are pretty easy to learn, but advanced usage requires a fair amount of dedicated time and effort. -- Best Regards, Chris Regular Expressions References and Resources by Christopher C. Stone 2015/03/20 --------------------------------- AppleScript-Objective-C Libraries --------------------------------- With the advent of Mavericks and AppleScript-Objective-C Libraries it is possible to add regex support to AppleScript via a library. ------------------------------------------------ Some Information on Learning Regular Expressions ------------------------------------------------ Learning basic regular expressions is relatively easy. Becoming really good with them takes dedication, a lot of practice, and some tutelage. The BBEdit & TextWrangler Manuals devote a whole chapter to regular expressions: Searching with Grep (currently chapter 8). It's a reference rather than a tutorial, but it does explain at least briefly many of the fundamentals. My cheat-sheet for BBEdit/TextWrangler is up on Gist: https://gist.github.com/ccstone/5385334 <https://gist.github.com/ccstone/5385334> BBEdit/TextWrangler uses PCRE (Perl Compatible Regular Expressions), so it's a pretty decent if not complete reference. ----------- Regex Books ----------- Regex neophytes are better off starting with a book specifically written for beginners. I have these books (in addition to a couple of tomes on Perl): "Sams Teach Yourself Regular Expressions in 10 Minutes" by Ben Forta "Beginning Regular Expressions" by Andrew Watt "Regular Expressions Cookbook" by Jan Goyvaerts and Steven Levithan "Mastering Regular Expressions" by Jeffrey Friedl (Advanced) --------------- Regex Analyzers --------------- Here's a very good on-line regex analyzer with an example: https://regex101.com/r/oA9mZ4/1 <https://regex101.com/r/oA9mZ4/1> There's a decent little utility available on the App-Store called Patterns <http://itunes.apple.com/us/app/patterns-the-regex-app/id429449079?mt=12> that live-updates as you create your pattern. ($2.99) Another one I like is: RegExRX <http://www.mactechnologies.com/index.php?page=downloads> Mark Alldritt the author of Script Debugger <http://www.latenightsw.com/> has posted a free one for the iPad: RegEx Knife <https://itunes.apple.com/us/app/regex-knife/id894169288> I've found it very handy to have live feedback when building a complex pattern and wish I'd had something like that when I started learning regex more than 20 years ago. ------------------------------------ Online Regex Tutorials & Information ------------------------------------ Extracting a good working knowledge of regular expressions from the Internet is a serious chore. There are many flavors of regex out there, such as Perl/PCRE, Java, Javascript, Ruby, Python, TCL... They are all similar, but the differences can be confusing and frustrating. Nevertheless there are many useful online resources. Here are a few: http://www.regular-expressions.info/tutorial.html <http://www.regular-expressions.info/tutorial.html> http://www.agillo.net/regex-primer-part-1/ <http://www.agillo.net/regex-primer-part-1/> http://www.agillo.net/regex-primer-part-2/ <http://www.agillo.net/regex-primer-part-2/> http://www.codeproject.com/KB/dotnet/regextutorial.aspx <http://www.codeproject.com/KB/dotnet/regextutorial.aspx> -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <https://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
