Space after line numvers

44 views
Skip to first unread message

Garrett Taylor

unread,
Jul 30, 2020, 3:09:15 PM7/30/20
to BBEdit Talk
Howdy,
 I would like to add spaces after line numbers. Is it possible?

Jim Witte

unread,
Jul 30, 2020, 3:19:32 PM7/30/20
to bbe...@googlegroups.com
find:
^([0-9]+[\.]{0,1})(.*)
replace with:
\1\s\s\s\1

Would that do what you want?  I'm not sure whether the «\s» in the replace string gets converted to a space character though, or if you actually just need to type spaces there.  \1 is a leading number and optional period, and \2 is the rest of the line.

On Thu, Jul 30, 2020 at 3:09 PM Garrett Taylor <garret...@gmail.com> wrote:
Howdy,
 I would like to add spaces after line numbers. Is it possible?

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/49f6174e-5054-49f4-9726-65163418c001o%40googlegroups.com.

ThePorgie

unread,
Jul 30, 2020, 3:22:52 PM7/30/20
to BBEdit Talk
Shouldn't that be "\1\s\s\s\2"


On Thursday, July 30, 2020 at 3:19:32 PM UTC-4, Jim Witte wrote:
find:
^([0-9]+[\.]{0,1})(.*)
replace with:
\1\s\s\s\1

Would that do what you want?  I'm not sure whether the «\s» in the replace string gets converted to a space character though, or if you actually just need to type spaces there.  \1 is a leading number and optional period, and \2 is the rest of the line.

On Thu, Jul 30, 2020 at 3:09 PM Garrett Taylor <garret...@gmail.com> wrote:
Howdy,
 I would like to add spaces after line numbers. Is it possible?

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbe...@googlegroups.com.

Jim Witte

unread,
Jul 30, 2020, 3:31:03 PM7/30/20
to bbe...@googlegroups.com
Yep - pesky typos..

To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/8c78b3a1-248f-4ed9-ad89-522dd172089do%40googlegroups.com.

Garrett Taylor

unread,
Jul 30, 2020, 4:02:31 PM7/30/20
to bbe...@googlegroups.com
Thanks Jim, 
It worked after I replaced the \s using the space bar tp create the spaces.
Garrett


Bruce Van Allen

unread,
Jul 30, 2020, 4:33:54 PM7/30/20
to bbe...@googlegroups.com
On 7/30/20 at 1:00 PM, garret...@gmail.com (Garrett Taylor) wrote:

>It worked after I replaced the \s using the space bar to create the spaces.

Yeah - \s matches a single whitespace character - spacebar
space, tab, carriage return, form feed, etc., in the search pattern.

But it doesn't stand for anything in the replacement (other than
itself - slash s).

HTH

--

- Bruce

_bruce__van_allen__santa_cruz__ca_

Darren Duncan

unread,
Jul 31, 2020, 8:57:22 AM7/31/20
to bbe...@googlegroups.com, Jim Witte
That solution is overly complicated, try this:

find:
^([0-9]+\.?)
replace:
\1

... where the replace has literal spaces after.

-- Darren Duncan

On 2020-07-30 12:14 p.m., Jim Witte wrote:
> find:
> ^([0-9]+[\.]{0,1})(.*)
> replace with:
> \1\s\s\s\1
>
> Would that do what you want?  I'm not sure whether the «\s» in the replace
> string gets converted to a space character though, or if you actually just need
> to type spaces there.  \1 is a leading number and optional period, and \2 is the
> rest of the line.
>
> On Thu, Jul 30, 2020 at 3:09 PM Garrett Taylor <garret...@gmail.com
> <mailto:garret...@gmail.com>> wrote:
>
> Howdy,
>  I would like to add spaces after line numbers. Is it possible?
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email "sup...@barebones.com
> <mailto:sup...@barebones.com>" rather than posting here. Follow @bbedit on
> Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+un...@googlegroups.com
> <mailto:bbedit+un...@googlegroups.com>.
> <https://groups.google.com/d/msgid/bbedit/49f6174e-5054-49f4-9726-65163418c001o%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature request
> or need technical support, please email "sup...@barebones.com" rather than
> posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to bbedit+un...@googlegroups.com <mailto:bbedit+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/CAEXAeDJo9LAc9%2BetLA%2B0Nq_-EwcNfEOnyorEidO9Cay%3DA44H%3Dw%40mail.gmail.com
> <https://groups.google.com/d/msgid/bbedit/CAEXAeDJo9LAc9%2BetLA%2B0Nq_-EwcNfEOnyorEidO9Cay%3DA44H%3Dw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages