# Urgend question for using REGEXP in find-query

**URL:** <https://www.ruby-forum.com/t/urgend-question-for-using-regexp-in-find-query/133682>\
**Category:** Rails\
**Created:** [April 2, 2008, 3:49pm UTC](https://www.ruby-forum.com/t/urgend-question-for-using-regexp-in-find-query/133682 "2008-04-02T15:49:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![der\_guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Post date:** [April 2, 2008, 3:49pm UTC](https://www.ruby-forum.com/t/urgend-question-for-using-regexp-in-find-query/133682/1 "2008-04-02T15:49:32Z")

</div>

Hi…

my table is Number… in this table I have column named “list”

each entry of a column has a list of numbers like:

“3452 45869 234 12”

know I have to know, how I can query the database via Number.find(:all,  
:condition =\> {…!!!..}) to find a specific number… a number can  
exists in different datasets… so I need all entries, where the number  
is in “list”.

normaly in SQL I use (searching for the number 234)

SELECT \* FROM Number WHERE `list` REGEXP ‘\s\*\s\*’

How can I use find with it?!?

thanks !

---

<div class="post-metadata">

**Author:** ![der\_guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Post date:** [April 3, 2008, 4:37am UTC](https://www.ruby-forum.com/t/urgend-question-for-using-regexp-in-find-query/133682/2 "2008-04-03T04:37:39Z")

</div>

Hi,

ARCLASS.find(:all, :conditions =\> ‘put the where statement in here’)

you can put “list REGEXP ‘\s\*\s’” as the conditions, and it should be  
fine.

Julian.

Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO  
(#2) OUT NOW!  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)
