Re: Range operations?

2011-03-18 Thread Steve Samuels
Mark- Not to beat a dead horse, but this script, based on one by Chris Stone at http://groups.google.com/group/bbedit/browse_thread/thread/1018c40d7e2c9ef, is much simpler than the one that depended on regular expressions. To include the line with HELLO remove the -1 from the -select- statement.

Re: Range operations?

2011-03-16 Thread Simdude
Looks great! Thank you again. I forgot BBedit was recordable. Definitely one of the nicer, real Mac apps out there. I find I've been using it for even non-programming work thanks to Hog Bays Quckcursor. Sort of a Edit in BBedit program that works with any text field. Mark On Mar 15, 1:04 pm,

Re: Range operations?

2011-03-14 Thread Simdude
Thanks again Steve. Actually, I wanted to perform an operation within a selection to mimic what vi can do by specifying a range. i.e. do a search and replace but only in a certain range. While it appears you can't directly do this in BBedit, your tip will allow me to first create a selection

Re: Range operations?

2011-03-13 Thread Steve Samuels
Mark, your original question was how to select up to the _line_ that contained HELLO. Here is a solution. Exclude the line from the selection: (?s).+?(?=((?-s)^.*HELLO.*$)) Include the line in the selection: (?s).+?((?-s)^.*HELLO.*$) Steve On Mar 10, 5:39 pm, Steve Samuels

Re: Range operations?

2011-03-13 Thread Steve Samuels
Mark, your original question was how to select all text from the cursor up to the _line_ that contains specified text. Here are solutions. Exclude the line from the selection: (?s).+?(?=((?-s)^.*HELLO.*$)) Include the line in the selection: (?s).+?((?-s)^.*HELLO.*$) These will fail if the

Re: Range operations?

2011-03-10 Thread Simdude
Thanks Chris. I did know about the selection operations but when you have to do this repeatedly in a file, it's not as efficient. Scripting is probably a better option but I'll have to improve my Applescript skills to be able to do this faster. For any Barebones guys, adding something like to to

Re: Range operations?

2011-03-10 Thread Steve Samuels
Searching for (?s).+?(HELLO) will select all text from the cursor up through the first HELLO and (?s).+?(?=HELLO) will select all text up to first HELLO. Steve On Mar 10, 8:35 am, Simdude markmille...@gmail.com wrote: Thanks Chris. I did know about the selection operations but when you

Re: Range operations?

2011-03-10 Thread Steve Samuels
You are welcome, Mark. To give you a head start, with references to the Manual for 9.6.3: (?s)says to skip over line endings ( p.188) .+?(HELLO) says to match any characters up to the first HELLO (non- greedy matching, p. 177) (HELLO) The parentheses aren't needed, but are useful for setting

Re: Range operations?

2011-03-10 Thread Steve Samuels
You are welcome, Mark. To give you a head start, with manual references: (?s) extends the search over line endings (p. 188) .+?HELLO searches text up through the first occurrence of HELLO (non- greedy matching, p. 177) (?=HELLO) says to search up to HELLO but not include HELLO in the found text

Range operations?

2011-03-09 Thread Simdude
Is there a way in BBedit to operate on ranges of data? For example, when I use vi, if I want to do a search and replace on all text from my current cursor to the line that contains HELLO, I would do this: :.,/HELLO/ s/this/that/g Can BBedit do this sort of range stuff? Mark -- You received

Re: Range operations?

2011-03-09 Thread Christopher Stone
On Mar 09, 2011, at 10:28, Simdude wrote: Is there a way in BBedit to operate on ranges of data? For example, when I use vi, if I want to do a search and replace on all text from my current cursor to the line that contains HELLO, I would do this: :.,/HELLO/ s/this/that/g Can BBedit do