Solved

Need help with a regular expression

Posted on 2014-11-29
5
88 Views
Last Modified: 2015-01-02
i need to parse some text and replace some stuff and i think regular expressions is the best way to go.

i need to find the following strings

A)  ",, , ," which is a comma + comma = space + comma + space = Comma
B)  ",,|"
c)  "2014-06-17 13:00:42,, , ," the date could always change


also is there a quick way to find with regular expression the following scenario wher there is always a 4 CHAR string
followed by 2 commas and i would like to change it to string and 1 comma like from "MB01,," to "MB01,"
0
Comment
Question by:AlexPonnath
5 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 40472197
A) /,, , ,/ or /,\+,= \+,\+ =,/ if I interpret the '+' and '=' in your description literally
B) /,,\|/
C) /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d,, , ,/
also) /.{4},/
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40472588
Blind link comment deleted

aikimark -- zone advisor
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40473822
ColdFusion doesn't use pattern delimiters, so you can drop the forward slashes ( / ) from ozo's suggestions. If Javascript is in use, then you will need to keep them.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now