Hello. I searched the NUG archives for any code pertaining to RegEx
and CSV (Comma Separated Values).
I came upon this formula from 2004: (?<=,)("[^"]*"|'[^']*'|[^,]*)(?=,)
Of course, when I set the search pattern to the above, I double-quote
the quotation marks.
When I feed the data into the RegEx search, I prepend and append
commas to the data.
The search works, but only returns the first value.
For testing, I used an example from WikiPedia:
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""",,4900.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00
For each of these values, I only receive back, 1997, 1999, 1996, and
air.
My routine looks like this:
reo.Greedy = true
re.Options = reo
re.SearchPattern = "(?<=,)(""[^""]*""|'[^']*'|[^,]*)(?=,)1)"
match = re.search("," + sDataLine + ",")
If match <> Nil then
iMax = match.SubExpressionCount-1
for iLoop = 1 to iMax
asReturn.Append match.SubExpressionString(iLoop)
next
End if
What am I doing wrong?
Thanks for the help,
Christian
Pariahware, Inc. Custom Software
<pariahware at pariahware dot com>
<http://www.pariahware.com>
--
God loved you so much that He gave His only son Jesus. What have you
done with God's gift?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Sun 25 Feb 2007 21:52:42 -0700
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id B49A81A8EAD0; Sun, 25 Feb 2007 20:52:49 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-2.6 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id A47E01A8EAC5;
Sun, 25 Feb 2007 20:52:48 -0800 (PST)
Received: from cust-66.116.103.65.switchcommgroup.com (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 5EAE5F1B71;
Sun, 25 Feb 2007 22:52:45 -0600 (CST)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id 85380F1B5C
for <realbasic-nug at lists dot realsoftware dot com>;
Sun, 25 Feb 2007 22:52:42 -0600 (CST)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id 654896FF9EA
for <realbasic-nug at lists dot realsoftware dot com>;
Sun, 25 Feb 2007 21:52:42 -0700 (MST)
Date: Sun, 25 Feb 2007 21:52:42 -0700
Subject: Re: OS X bug: sounds stop playing
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <5C21C51F-546B-48E0-8518-B1843CF7B1D5 at bainsware dot com>
X-Mailer: VerEx Email Gateway
Message-Id: <20070226045242 dot 654896FF9EA at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Feb 26, 2007, at 04:43 UTC, Navdeep Bains wrote:
> I've had the same problem since I installed the latest Security
> Update. Never saw this on my PPC machine, so I'm assuming it's Intel-
> specific. iTunes works fine, but there's no audio in Safari when
> playing a Quicktime movie or in iChat when someone logs in/out.
Good to know it's not just me -- it really has to be an OS bug, I
think. I just launched Garage Band on a whim, and while it was
initializing, it made a "click" sound through my speakers. After that,
everything was back to normal: Sys7 sounds play in the Finder, all my
games with sound effects play them again, etc. Whatever weird state my
system had gotten itself int, Garage Band forced it back out.
So, this appears to be a work-around for me; maybe it will work for you
too.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Sun 25 Feb 2007 21:59:37 -0700
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id C2D581A8EBE3; Sun, 25 Feb 2007 20:59:44 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-2.6 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id 642D61A8EBD8;
Sun, 25 Feb 2007 20:59:43 -0800 (PST)
Received: from cust-66.116.103.65.switchcommgroup.com (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 9C1F8F1BF6;
Sun, 25 Feb 2007 22:59:39 -0600 (CST)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id A42B4F1BEB
for <realbasic-nug at lists dot realsoftware dot com>;
Sun, 25 Feb 2007 22:59:37 -0600 (CST)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id 82BDD6FFA0F
for <realbasic-nug at lists dot realsoftware dot com>;
Sun, 25 Feb 2007 21:59:37 -0700 (MST)
Date: Sun, 25 Feb 2007 21:59:37 -0700
Subject: Re: Games list - now lots of questions - please Help!
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <754A2513-3560-4DAB-BD07-04C4A7C03EB5 at bwahaha dot net>
X-Mailer: VerEx Email Gateway
Message-Id: <20070226045937 dot 82BDD6FFA0F at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Feb 26, 2007, at 04:00 UTC, Harry Morris wrote:
> Thanks! It looks like the problem was lack of Quesa. Interesting
> that it kept the program from compiling, rather than producing a run
> time error.
Yes, the IDE needs the plugin to load, and the plugin needs Quesa. It
didn't use to be that way, and there's really no reason it should be
that I can think of. Indeed, many of the services that plugin provides
(basic Vector3D math, for example) shouldn't need Quesa at all.
I believe there's a bug report/feature request to restore this to the
previous state of running (in a limited fashion) without Quesa around,
but I don't know the feedback ID. But it may be related to this one:
<http://www.realsoftware.com/feedback/viewreport.php?reportid=zbmmbaqc>
> Putting Quesa in place didn't help until I closed the
> project and reopened it.
I'm very surprised you didn't have to restart the IDE!
> The problem is that as a beginner PEF and Mach-O mean nothing to me.
> I suspect it has to do with Intel vs PowerPc, or maybe between OS X
> and OS 9?
Ah, I see. OK, here's the deal in a nutshell: there are two formats
for executable (application) files on the Mac: PEF, which is a modern,
sensible format that the Mac has always used up until recently, and
Mach-O, which is an older, more primitive format that Steve Jobs used
at NeXT and then foisted onto the rest of us when he returned to Apple
and came out with OS X (which is just NeXT in a Mac's clothing in many
other ways, too). PEF apps can run on OS 9 and OS X, but they can only
contain PowerPC code. Mach-O apps only run on OS X, but they can
contain either PowerPC or Intel code. So, unfortunately, since modern
Mac hardware is Intel, we have to use the Mach-O format, which means
your apps won't run on OS 9 anymore.
Mach-o apps also make declares differently, as this error message was
pointing out. See <http://www.declaresub.com/ideclare/>, an excellent
online book by Charles Yeomans, for everything you ever wanted to know
about declares (and more!).
> My best guess would be that it's a Intel vs PowerPC thing, but
> setting the build settings to Mac OS PowerPC still gives an error.
> So I'm confused.
Yeah, the build settings are confusing. But rather than mucking with
them, just search and replace "CarbonLib" with "Carbon" and I bet
you'll be better off (and then you can build for Intel, though not for
OS 9).
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|