I'm starting to program, so forgive me if this is terribly obvious (which would be great news).
I do PHP development in my free time using pregmatch and recording most of my expressions with the free open source Reggex tester.
However, often I find that I just want to quickly extract something, and the only way I know it is to write my expression and then script it, which is probably funny, but welcome to my reality. :-)
What I would like is something like a simple text editor in which I can transfer my expression (given a file or buffer with embedded text) and parse this expression and return the document with the results only.
What I find is usually a regular search / replace function, as in Notepad ++, I can easily find (and replace) all instances with an expression, but I just don't know how to extract it ...
And this is probably terribly obvious, can the expression only correspond to the opposite? Then I could use something like (only the expression I'm working on now):
<a href="/browse/0/b/-dbm/a/0-0/1200000([^/]*)/0.html">([^<]*)</a>
And replace anything that doesn't match with anything. But I am sure that this is something common and simple, I would really appreciate any pontiers.
FWIW I know grep, and I could do it using this, but I hope this is the best gui-s solution that I just donβt know about.
Thanks.
Zach
What I was hoping for would be something that would work in a more standard set of gui tools (i.e. tools that I could already use). I am grateful to all the answers, but using perl or vi or grep is what I was hoping to avoid, otherwise I would just write it myself (of course, I did), since all of them are relatively powerful low-level tools.
Perhaps I was not clear enough. As a senior system administrator, cli tools are familiar to me, I love them very much. While working at home, I find most of my time spent in gui, such as Netbeans or Notepad ++. I just think that there will be an easy way to achieve regular expression extraction using these tools (since in these cases I already used them).
Something vaguely similar to what I had in mind would be this , which will take the expression aa on the first line and url on the second line and then extract (return) the data.
It's ugly (I'll take it off after tonight because it's probably riddled with problems).
Anyway, thanks for your answers. I appreciate it.