You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m stuck on how to build a GREP query in TextMate.
I want to search all of the articles in a particular directory for:
all words ending with *tor (like inhibitor, constrictor, etc)
and include [x] number of words (or characters, if need be) before after the found terms.
I need to use TextMate because its find/replace preview window a) shows me just results (it hides anything outside my search parameters), and b) it allows me to copy only what is visible in that preview pane and paste into another document where I can work the set I just found.
I've searched around online and found various discussions on on stack overflow etc., but none of them are working for me.
On Fri, May 15, 2020 at 10:43 PM Emanuel Faria ***@***.***> wrote:
@petermr <https://github.com/petermr> I need some help...
I’m stuck on how to build a GREP query in TextMate.
It's normally capitalized as "grep"
I want to search all of the articles in a particular directory for:
- all words ending with *tor (like inhibitor, constrictor, etc)
- and include [x] number of words (or characters, if need be) before
after the found terms.
I need to use TextMate because its find/replace preview window a) shows me
just results (it hides anything outside my search parameters), and b) it
allows me to copy only what is visible in that preview pane and paste into
another document where I can work the set I just found.
I would start small . Use \W (word boundary)
Make an example target like:
"constructor destructor and tor and tortuous and contortion"
bring up the "find" widget (CtrlF)
and try to following search strings
type \Wtor\W matches *tor*
tor\W matches *constructor* , *destructor* and *tor*
\Wtor matches *tor* and *tortuous*
Then try non-word-boundary \w (BTW you need to be very case-sensitive)
\wtor\W matches constru*ctor* and destru*ctor*
\w[^\s]+tor\W matches *constructor* and *destructor *but not "tor"
Try that, play with TextMate till you can get it right.
Then you want to "capture" the matches,
—
Activity
petermr commentedon May 16, 2020
EmanuelFaria commentedon Jun 22, 2020
thanks Peter![[selfie-0 uploading...]]