For Programmers: Free Programming Magazines  


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
Anze

2005-09-28, 6:58 pm

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
Anze

2005-09-29, 6:57 pm


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


Vigil

2005-09-29, 9:56 pm

On Fri, 30 Sep 2005 00:26:09 +0200, Anze wrote:
[color=darkred]

Cannot. Must use your client / app.

--

..

Anze

2005-10-03, 6:57 pm

> Cannot. Must use your client / app.

Thank you for the answer - i was afraid of that.

Kind regards,

Anze
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com