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

  • Home
  • SEARCH
  • 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 6750957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:52:11+00:00 2026-05-26T12:52:11+00:00

How to match a tab only when it is between two numbers? Sample script

  • 0

How to match a tab only when it is between two numbers?

Sample script

209.65834   27.23204908
119.37987   15.03317082
74.240635   8.30561924
29.1014 0

931.8861    -100.00000
-16.03784   -8.30562
;   
_mirror 
l   

;   
29.1014 0
1028.10 0.00
n   
_spline 
935.4875    250
924.2026913 269.8820375
912.9178825 277.4506484
890.348265  287.3181854

(in the above script, the tabs are between the numbers, not the spaces) (blank lines are significant; there is nothing in them, but I can’t lose them)

I wish to get a “,” between the numbers. Tried with :%s/\t/\,/ but that will touch the empty lines too, and the end of lines.

  • 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-05-26T12:52:12+00:00Added an answer on May 26, 2026 at 12:52 pm

    Try this:

    :%s/\(\d\)\t\(-\?\d\)/\1,\2/
    

    \d matches any digit. -? means “an optional -. The pair of (escaped) parenthesis capture the match, and \1 refers to the first captured match, \2 refers to the second.

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

Sidebar

Related Questions

I am trying to match floating-point decimal numbers with a regular expression. There may
I have two tab-delimited genome sequence files (SAM format), and I would like to
I've got a tough one. I've got tab-delimited text to match with a regex.
Problem: to have a tab completion which takes two words and calculates the best
I'm looking to write / emulate a tab strip using HTML & CSS only.
match.matches() returns false. This is odd, because if I take this regex and test
preg_match() gives one match. preg_match_all() returns all matches. preg_split() returns all splits. How can
pathTokens match { case List(post) => (post, index) case List(search) => (search, index) case
String match = hello; String text = 0123456789hello0123456789; int position = getPosition(match, text); //
I need to match and remove all tags using a regular expression in Perl.

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.