The problem is in defining "between quotation marks" because technically
in "testuser1","testuser2" the comma *is* between quotation marks.  I
can see how you could loop over the string and keep the pairs consistent
that way, but I can't off the top of my head think of a way to do it
with a single regex.

Here's another way to look at it:
you have a quotation-mark-delimited list with throwaway members that
just contain commas.

I don't know if that will be the right way to go about it, but it might
be worth considering.

If not, I would use a find() to locate all the quotes and work with them
in pairs that way, removing/replacing commas between them.

HTH.

--Ben Doom

Allan Clarke wrote:
> I want to use a regular _expression_ that
> finds any commas that are between quotation marks and
> either escapes them or replaces them
>
> Here is an my string.
>
> 2003/09/09 14:49:05, "TestUser1",
> "/Doc/News/Budgeting,Forecasting & Reporting.doc",
> "OK"
>
> As you can see "/Doc/News/Budgeting,Forecasting &
> Reporting.doc" has a comma in it. The example above is
> a list with 4 items:
>
> 2003/09/09 14:49:05
> "TestUser1"
> "/Doc/News/Budgeting,Forecasting & Reporting.doc"
> "OK"
>
> But because the string
> ("/Doc/News/Budgeting,Forecasting & Reporting.doc")
> has
> a comma the list len comes back with 5 items which is
> wrong. Can you show me how to get around this? Many Thanks
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to