Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Alicante, Spain
    Posts
    2

    Unanswered: how to test string against regular expression contained in postgresql database field

    Hi All,

    I have a table which contains a field with regular expressions. I want to test a given string against this field to obtain the resulting records but I am doing something wrong and cannot find out what.

    table
    os_regexp os_name
    ------------- -----------
    win.*9x windows
    linux linux
    etc...

    select os_name from table where 'windows9x' ~ os_regexp;
    ERROR: invalid regular expression: empty expression or subexpression.


    Any help appreciated, Joe.

  2. #2
    Join Date
    Mar 2004
    Location
    Alicante, Spain
    Posts
    2

    Answered on usenet

    Thank you very much for your answer. You were right, I had an empty
    field in one of my rows.

    It was my fault. I should have stopped and thought before jumping to
    conclusions :-)

    Regards, Joe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •