Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

search and replace

Posted on 2002-06-01
2
Medium Priority
?
225 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 85

Accepted Solution

by:
ozo earned 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Six Sigma Control Plans

963 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