Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:45:19+00:00 2026-06-16T03:45:19+00:00

Here’s an example text I’m trying to format: (9 12 19 38 0 -39

  • 0

Here’s an example text I’m trying to format:

(9 12 19 38 0 -39 -20 -13 -10)
(7 9 14 29 0 -30 -15 -10 -8)
(4 6 9 19 0 -20 -10 -7 -5)
(2 3 4 9 0 -10 -5 -4 -3)
(0 0 0 0 0 0 0 0 0)
(-3 -4 -5 -10 0 9 4 3 2)
(-5 -7 -10 -20 0 19 9 6 4)
(-8 -10 -15 -30 0 29 14 9 7)
(-10 -13 -20 -39 0 38 19 12 9)

I would like each column to align on digits, (i.e. if there’s a minus sign, add extra space).

If I do it like so: C-uM-xalign-regexpRET\([[:digit:]]+\)RETRETRETy

I get this:

(9  12 19 38 0 -3 -2 -1 -1)
(7  9  14 29 0 -3 -1 -1 -8)
(4  6  9  19 0 -2 -1 -7 -5)
(2  3  4  9  0 -1 -5 -4 -3)
(0  0  0  0  0 0  0  0  0 )
(-3 -4 -5 -1 0 9  4  3  2 )
(-5 -7 -1 -2 0 19 9  6  4 )
(-8 -1 -1 -3 0 29 14 9  7 )
(-1 -1 -2 -3 0 38 19 12 9 )

which is very close, but not what I want.

And if I try to modify the expression to include the minus sign, like so: \(-?[[:digit:]]+\)

Then I get this:

(9 1 1 3 0 - - - -)
(7 9 1 2 0 - - - -)
(4 6 9 1 0 - - - -)
(2 3 4 9 0 - - - -)
(0 0 0 0 0 0 0 0 0)
(- - - - 0 9 4 3 2)
(- - - - 0 1 9 6 4)
(- - - - 0 2 1 9 7)
(- - - - 0 3 1 1 9)

Is this a bug, or is there something I don’t know?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:45:20+00:00Added an answer on June 16, 2026 at 3:45 am

    The text matched by the designated group (usually group 1) is expanded or shrunk, so non-whitespace characters in the group are subject to deletion, as you saw. Unless, that is, justification is enabled, which is indicated by supplying a negative group number to align-regexp:

    C-uM-xalign-regexpRET\(\s-*-?\)[0-9]+RET-1RETRETy

    If you want, you can align the columns on the ones digits of each number by including the digits in the match group:

    C-uM-xalign-regexpRET\(\s-*-?[0-9]+\)RET-1RETRETy

    In either case, an extra space will be inserted after each opening parenthesis. I don’t see any way to keep align-regexp from doing this, but if you do it often you could wrap it in a command that does the align-regexp, then replaces the regexp "^( " with "(" everywhere in the original region.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code in a function I'm trying to revise. This example works
Here's what I'm trying to do... It's quite simple and obviously there must be
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is an object that I'd like to use with ng-repeat, but it's not
Here I am trying to retrieve the response from the server and display it,
Here is what I am trying to achieve in PHP: I have this string:
Here's what I'd like to do: have a banner across the top of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.