Re: GREP/Regex for dummies?

2011-09-06 Thread Ronald J Kimball
On Tue, Sep 06, 2011 at 07:50:30AM -0700, jefferis wrote: Hi,all. I'm trying to do the research and learn the proper syntax, but I keep getting confused by the web page descriptions. Just a little background: I am a visual learner. I was great in Geometry but my algebra teacher said Jeff tries

Re: GREP/Regex for dummies?

2011-09-06 Thread Fletcher Sandbeck
On Sep 6, 2011, at 7:50 AM, jefferis wrote: My client wants me to take a tool tip for hundreds of items and wants me to add a tab after the item number and then remove numbers at the end of the phrase. As a sample the numbers and letters up to the first space are the item number.

Re: GREP/Regex for dummies?

2011-09-06 Thread Jefferis Peterson
On 9/6/11 12:00 PM, Ronald J Kimball r...@tamias.net wrote: Thanks for the references! I'll look into them. I like to understand what I'm doing and that is why just having the pocket reference may not be enough for me... Also like looking at formulas alone... It is harder for me to grasp what I'm

Re: GREP/Regex for dummies?

2011-09-06 Thread Jefferis Peterson
On 9/6/11 12:24 PM, Fletcher Sandbeck fletc...@cumuli.com wrote: BBEdit's help contains a good introduction to regular expressions and GREP. I find most of the O'Reilly books little better than the help available online, but YMMV. I usually just google regular expression converting telephone

Re: GREP/Regex for dummies?

2011-09-06 Thread Bruce Van Allen
On 2011-09-06, Jefferis Peterson wrote: Find: ^([A-Z0-9]+) (.*) [0-9]+$ Replace: \1\t\2 But without the delimiters, it processed the page perfectly. Thanks for my first lesson in depth OBI-WAN :-) A guess is that the the non-matching lines have some extra whitespace at the start or end of

Re: GREP/Regex for dummies?

2011-09-06 Thread Jefferis Peterson
On 9/6/11 2:24 PM, Bruce Van Allen b...@cruzio.com wrote: Find: ^\s*([A-Z0-9]+) (.*) [0-9]+\*s$ Replace: \1\t\2 That didn't work either, but I opened a fresh copy of the original text and removed the \s* and it worked on all lines ^([A-Z0-9]+) (.*) [0-9]+ $ Just curious... A space in the

Re: GREP/Regex for dummies?

2011-09-06 Thread Chip Warden
On Sep 6, 2011, at 12:01 PM, Jefferis Peterson wrote: I read the reviews and thought I should try something a bit more basic so I ordered: Regular Expressions Cookbook [Paperback] Jan Goyvaerts (Author), Steven Levithan (Author) Which appears to be a better introduction for someone my speed.

Re: GREP/Regex for dummies?

2011-09-06 Thread Doug McNutt
At 14:58 -0400 9/6/11, Jefferis Peterson wrote: ^([A-Z0-9]+) (.*) [0-9]+ $ Just curious... A space in the Find field using Grep... Isn't seen is it? Like the space before the $ ? If no spaces are found before or after in your original Find above, does that stop the search? IOW, what is the

Re: GREP/Regex for dummies?

2011-09-06 Thread John Delacour
At 14:58 -0400 06/09/2011, Jefferis Peterson wrote: IOW, what is the symbol for optional but not necessary spaces? This should be near the first page of anything you read about regex. ab\s*c will match abc and ab[any amount of white space]c Paste this into a BBEdit doc and run it from