Page 1 of 1

More Regular Expression examples in the Help needed

Posted: Wed Mar 13, 2013 11:02 pm
by Aeneas
When I need to do Regular Expressions in the find capability,
I would like to see better reminders in the Help of how to perform
certain RE operations. Three in particular:

1) how to match lines which match a string but exclude another string
e.g. match all lines containing string A, but excluding any of those matched lines if they also contain string B,
2) match string "the" but exclude if it is "their"
3) match either "function_A(" or "function_A ("
etc.

Many Internet Search Engines accomplish 1 and 2 with a simple minus (-) syntax.
The Help should also include several Ctrl-R, that is, search and Replace Regular Expression options.
When I remembered how to do this,
search and replace RE's were just as important as search RE's.
RE's are an infrequently used syntax, which can save enormous amounts of search and editing time in unusual situations.
However, it is infrequent enough that users can forget how, without reminders in the Help.

Re: More Regular Expression examples in the Help needed

Posted: Fri Jul 19, 2013 12:55 am
by jeffy
Aeneas wrote:2) match string "the" but exclude if it is "their"
3) match either "function_A(" or "function_A ("
etc.
2) search non-regex whole-word for "the", or regex "\<the\>"
3) Regex: "function_A[ ]{0,1}\("

Posted: Tue Oct 15, 2013 9:23 am
by Kelly
Aeneas is lucky he has something to try and remember - quite possibly he's forgotten more than I'll ever know ;)

I came combing through the forum postings hoping to maybe find more in terms of tutorials or other learning tips for regular expressions in TextPad for folks like me that aren't programmers.

Thank you.

Kelly

Posted: Wed Oct 16, 2013 12:46 pm
by Kelly
This book looks like a handy thing to have on the reference shelf (just ordered it :)

Image

Posted: Wed Oct 16, 2013 12:47 pm
by jeffy
*THE* book on regular expressions.

another resource for newbies to regex

Posted: Thu Oct 17, 2013 7:35 am
by Kelly
This site is very much worth looking into for interactively learning regex:
http://regexone.com/