Re: Use GREP to select all characters up to a character

2019-12-20 Thread ctfishman
Select: ^([^\]*) If you want to just retain everything up to the slash and get rid of the rest, select: ^([^\]*)\\.* and replace with \1 The part in parentheses is selecting zero or more characters from the start of the line which are not a backslash. Alternatively if there is exactly one

Re: Appending a string using Search and Replace

2020-01-14 Thread ctfishman
You can also use an ampersand in the replace string to indicate the entire contents of the match, ie: &, UNKNOWN will give you the same thing as the \1 version. The difference is the \1 version requires the match to be captured in parentheses and the & version does not. -- This is the BBEdi

Regex help - matching unique URLs and deleting HTML encoding

2020-01-27 Thread ctfishman
Find: ]+>(.*?) Replace: \1 This will find the a tag, followed by the shortest string possible, followed by the closing tag. If you don’t have the question mark it won’t work correctly if there is more than one link on a line. -- This is the BBEdit Talk public discussion group. If you have a

Re: Maintaining a variable(?) to prefix future text

2020-05-01 Thread ctfishman
Hi Peter - You can do this with a text filter. Save the following code in a file called something like "date_prefixer.pl", put it in your text filters folder, then go back to your file and choose Text -> Apply Text Filter - date_prefixer from the menubar. What the script does: 1) Loops throug

Keep Text Filter Output In Original Window

2021-04-15 Thread ctfishman
I have the following perl script as a text filter. It is designed to take the lines being acted on and run each as a unix command. The script does run the commands, but instead of putting the output back in the original file it opens the Unix Script Output log and puts it there. I have a number

Re: Keep Text Filter Output In Original Window

2021-04-15 Thread ctfishman
Thanks Jean, but I do have it in the text filters folder and am calling it via "Text > Apply Filter". On further investigation, it seems to have been because a command I was running generated a warning: echo "Some Text" ^prints to the document ssh devserver "echo 'some text'" ^prints to the do

Re: Keep Text Filter Output In Original Window

2021-04-15 Thread ctfishman
Thanks Patrick, that explains it. The commands I was running didn't return any output but they did return a warning. That's why I mistakingly thought that everything was going to the log window. On Thursday, April 15, 2021 at 3:59:30 PM UTC-4 Patrick Woolsey wrote: > This is the expected behavi

Re: Keep Text Filter Output In Original Window

2021-04-16 Thread ctfishman
Thanks for the tip Charlie. In this case I did in fact want to mimic the way a shell worksheet works. Adding "open STDERR, '>&STDOUT';" to the start of my script did just that. On Thursday, April 15, 2021 at 8:00:13 PM UTC-4 Charlie Garrison wrote: > On 16 Apr

Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-14 Thread ctfishman
I tried doing this with just a regular expression but couldn't figure out how. I was however able to do it quite easily with a text filter. The following PERL example works for me to split the text and create and save an individual file for each chapter. Save the following in your text filters

Re: Help from the clueful

2013-02-17 Thread ctfishman
Save the following perl script as a filter and it should do the trick (worked on your sample data, did not test it any further then that): #!/usr/bin/perl while (<>) { #remove the line break character chomp($_); #split the line into the starting number and following text ( $numb

Re: Help from the clueful

2013-02-17 Thread ctfishman
I posted this reply already but it seems to have disappeared in some Google Groups strangeness. Run the following perl script on your data as a filter and it will do what you want: #!/usr/bin/perl while (<>) { #remove the line break character chomp($_); #split the line into the starting n

Pass Parameters to Text Filter Script

2013-02-24 Thread ctfishman
Is it possible to pass parameters to a script being run as a text filter? I have a perl script that I use to adjust html code that has a number of instances like this: "top: 753px; left: 27px;" "top: 1928px; left: 776px;" and add a specified amount to each "top" and "left" value by executing co

Re: any way to easily see what has changed when Asked Do you want to Save the changes when closing?

2014-05-15 Thread ctfishman
Clicking the "cancel" option in the save dialog will abort the quit. On Wednesday, May 14, 2014 4:33:25 PM UTC-4, rarpsl wrote: > > At 08:56 -0700 on 05/14/2014, Oliver Taylor wrote about Re: any way > to easily see what has changed when Asked Do yo: > > >On 14 May 2014, at 8:45 AM, Ken G. Brown

Re: Keeping BBEdit settings of several Macs in sync

2014-08-24 Thread ctfishman
What about replacing the plists with symbolic links named com.barebones.bbedit.plist in ~/Library/Preferences/ on each machine, and linking the symlinks to the actual plist file stored somewhere within Dropbox? I recall that worked for doing what the official Dropbox syncing does now prior to

Re: Keeping BBEdit settings of several Macs in sync

2014-08-25 Thread ctfishman
Thanks for the explanation Rich, makes perfect sense. See, I told you it wouldn't work. On Sunday, August 24, 2014 11:06:08 PM UTC-4, Rich Siegel wrote: > > On Sunday, August 24, 2014, ctfishman > > wrote: > > >What about replacing the plists

Re: line sorting from cursor position

2017-06-20 Thread ctfishman
With a simple Applescript, you can perform the sort Patrick describes starting from the current cursor position. The following script gets the cursor position, creates the grep pattern for the sort using the cursor position as the start point, then performs the sort. *tell* *application* "BBEdi

Re: Change path in BBedit Project?

2017-08-08 Thread ctfishman
1) With the original project file not open, make a copy of it in the Finder. 2) Ctrl-click on the project file in the Finder and select "Show Package Contents". 3) Open the file you see named "project.bbprojectdata" in BBedit. 4) Do a replace all for "/Volumes/LSMnowStaging" with "/Volumes/LSM

Re: Tidy

2018-02-12 Thread ctfishman
#!/bin/sh tidy Save the two lines above as "Tidy.sh" in your text filters folder (most likely /Users//Library/Application Support/BBEdit/Text Filters/). Then under the menu Text -> Apply Text Filter you'll see an option for "Tidy". You can even assign it a keystroke if you want. On Sunday, Feb