Solved

search and replace

Posted on 2002-06-01
2
191 Views
Last Modified: 2010-03-05
Hi:

I have a pattern like this

"1,885,5002,666,59026."

and i want to separate out as
"1,885,500"  "2,666,590" and "26."

basically it should split the 3 groups depending on
the property a comma can split a max of 3 chars.

right now I am searching for [0-9]\{4,9} which
highlights the 5002 and 59026 in the above example.

Can somebody please enlighten me how I can split it
into those 3 groups?

This above pattern is part of this string

A 26.37 1,885,5002,666,59026.1326.00 - 26.79
which is a stock price for the day.

Thanks
0
Comment
Question by:mbormann
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
ID: 7048962
s/(\d{3})(?=\d)/$1 /g;
0
 
LVL 5

Author Comment

by:mbormann
ID: 8096967
Sorry I clean forgot about this one. Thanks for the answer!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question