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.
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,
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
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
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
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
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
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
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
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
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
11 matches
Mail list logo