Help with Regex (was Re: Switch, Case and wild-cards?)

Peter Haworth pete at lcsql.com
Tue Jan 1 11:16:55 CST 2013


These would be guaranteed valid SQLite statements so their syntax would be
exactly as documented, no errors.  SOunds like it might be worthwhile
spending a couple of hours with regex as an exercise to do this.
Pete
lcSQL Software <http://www.lcsql.com>


On Tue, Jan 1, 2013 at 5:10 AM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> From my own experience; if you are trying to parse ANY SQL statement that
> someone might enter, then NO, regex alone is not going to be your solution.
> If on the other hand you are dealing with a relatively small subset of SQL
> statements, maybe SELECT, UPDATE, DELETE, then regex would be able to very
> quickly break these down into table/column names and values, etc etc.
>
> Because SQL is so structured and strict (more so say than the 4.0 version
> of html which is fairly loose in what it allows) it does lend itself to be
> manipulated with regex.
>
> HTH
>
> On Sun, Dec 30, 2012 at 3:02 PM, Peter Haworth <pete at lcsql.com> wrote:
>
> > Thanks Mark, more good resources.
> >
> > A question in the back of my mind now that I know enough about regexp to
> be
> > dangerous.  Is parsing a language something that can be done with regular
> > expressions?  I have a program in which I jumped though all sorts of
> hoops
> > to parse SQL statements.  It works quite well but maintaining it is a
> pain.
> >  It feels like I could use regexps to separate the various "clauses" of a
> > command, followed by other regexps to parse those clauses depending on
> > type.
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> > On Sat, Dec 29, 2012 at 7:47 PM, Mark Laffoon <mark.laffoon at gmail.com
> > >wrote:
> >
> > > I've always found RegExhibit from
> > > http://roger-jolly.nl/software/#regexhibithelpful.
> > > Also, for reference material,  http://www.regular-expressions.info/has
> > > been of great help.
> > >
> > > Just my 2 cents.
> > > Mark
> > >
> > >
> > > --
> > > I am CDO. This is a lot like OCD, except the letters are in
> alphabetical
> > > order... as they should be.
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list