Home > Archive > PHP SQL > October 2005 > getting REGEXP query
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
getting REGEXP query
|
|
|
| Hi all!
I have a MySQL database that contains URLs and would like to fetch different
domain names from the field. Is there some sort of regular expression match
function? I need something like:
SELECT REGEXP('^(http://)?([^/])+/.*$', t.url, '$1') FROM my_table t;
That is, I need some sort of string function that would return a part of the
string based on a regular expression match.
Am I missing something? I looked around but couldn't find it. It looks very
basic stuff to me, there must be something like that out there?
Any advice would be welcome.
Kind regards,
Anze
| |
|
|
Please, anyone? Is it possible? I really need this...
Kind regards,
Anze
Anze wrote:
> Hi all!
>
> I have a MySQL database that contains URLs and would like to fetch
> different domain names from the field. Is there some sort of regular
> expression match function? I need something like:
>
> SELECT REGEXP('^(http://)?([^/])+/.*$', t.url, '$1') FROM my_table t;
>
> That is, I need some sort of string function that would return a part of
> the string based on a regular expression match.
>
> Am I missing something? I looked around but couldn't find it. It looks
> very basic stuff to me, there must be something like that out there?
>
> Any advice would be welcome.
>
> Kind regards,
>
> Anze
| |
|
| On Fri, 30 Sep 2005 00:26:09 +0200, Anze wrote:
[color=darkred]
Cannot. Must use your client / app.
--
..
| |
|
| > Cannot. Must use your client / app.
Thank you for the answer - i was afraid of that.
Kind regards,
Anze
|
|
|
|
|