Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to extract searched data using Regex


  • Please log in to reply
2 replies to this topic
4birds
  • Members
  • 185 posts
  • Last active: Jan 18 2016 11:40 PM
  • Joined: 06 Mar 2008

I recently downloaded the pdf called bastards-regexes, here's the link.  http://regex.bastardsbook.com/  It's pretty well written for newbies.

 

I've never even bothered learning Regex but am trying to pick a little bit up because of some large data sorting I'm trying to do. So I'm using the text editor Sublime text 2 to try and find certain character occurences.  Using the find function I was able to isolate all 1346 matches.

My question is now that I have the occurences matched, how can I extract them to a file?  Any suggestions? Here's the regex code I was using. Is it even possible?

(^P[A-Z][(A-Z)|\d][(A-Z)|\d])


faqbot
  • Members
  • 997 posts
  • Last active:
  • Joined: 10 Apr 2012
I assume you've hit find all, which means all 1346 matches are now highlighted / selected, so creating a new file is as easy as ctrl-c, ctrl-n (create new file), ctrl-v. :-)

4birds
  • Members
  • 185 posts
  • Last active: Jan 18 2016 11:40 PM
  • Joined: 06 Mar 2008

Faqbot, thanks. Super embarressed. It worked great.