Solved

Need help with a regular expression

Posted on 2014-11-29
5
84 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 74

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

706 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

22 Experts available now in Live!

Get 1:1 Help Now