Re: OT - Validating Regular Expression in java

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: OT - Validating Regular Expression in java
Дата
Msg-id Pine.BSO.4.56.0411041036520.17744@leary.csoft.net
обсуждение исходный текст
Ответ на OT - Validating Regular Expression in java  (David Gagnon <dgagnon@siunik.com>)
Список pgsql-jdbc

On Thu, 4 Nov 2004, David Gagnon wrote:

> I think you guys are the ones who can help me :-)
>
> My web site offers a search which supports regular expression (POSIX).
> I'm looking for a way to validate the regular expression in the
> application before sending it the the DB.  For now Postgresql throwing
> an error on invalid regular expression.

I'd say just go ahead and send it to the db.  Getting a java regex package
to match up *exactly* with pg's seems rather unlikely.  Why not just let
pg tell you if it was valid or not?  I'm guessing you want to detect regex
errors from other sql errors, but SQLException.getSQLState() should do
that for 7.4+ servers.

Kris Jurka


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: David Gagnon
Дата:
Сообщение: OT ? - Validating POSIX Regular Expression in Java
Следующее
От: "Daron"
Дата:
Сообщение: