title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Thursday, January 12, 2012 | |
Now this is pretty cool, other than Javascript not supporting it... The RegEx Lookbehind. You can find a pattern and return hits only when it's not preceded by another pattern. So I wanted to find where something was declared in a web/javascript app, not where it was instantiated by pulling it back by id. In this case, we're using the ExtJS framework (probably not my first choice, but a good, robust lib), so document.getElementById() or a jQuery $() is replaced by Ext.getCmp(). So I want to find any example of theObject that's not in the format... Ext.getCmp("theObject") Which is to say, I want to find any theObject not preceded by Ext.getCmp(" Here's the lookbehind-ige... (?<!Ext\.getCmp\(")theObject SHAZAM. That's neat. And though it'll chew, JEdit will recursively Hypersearch that into a directory tree, no problems. And then it'll clue me in that I need to say either " or ' in the regexp. Ooops. (?<!Ext\.getCmp\(["|'])theObject Cool. Labels: problem solved, regexp posted by ruffin at 1/12/2012 12:34:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|