Re: Can I get the matching expression from REGEXP

2002-12-11 Thread Mike Bosschaert
Thanks for the reply. I agree on the scripting languages. However it was a one time conversion problem. I managed with the substring_index sugestion. Regards, Mike On Wednesday 11 December 2002 02:05, Robert Citek wrote: Hello Mike, The short answer: use Perl, Python, Ruby, etc. You are

Can I get the matching expression from REGEXP

2002-12-10 Thread Mike Bosschaert
Hi, In one of my tables I have a column which contains a combination of a string (characters only), a space and a 1 or 2 letter combination. The string has no fixed lenght. Like: abcd ef bcdefgh i etc Now I want to remove the 1 or 2 letter combination from this column into another

Re: Can I get the matching expression from REGEXP

2002-12-10 Thread Andy Bakun
Look up SUBSTRING_INDEX in the mysql manual. select SUBSTRING_INDEX(colX,' ',-1) from table is what I think you want. This will return everything after the first space found. May want to stick an if(...) construct in there for where you don't want the rows without the spaces (see below). Then

Re: Can I get the matching expression from REGEXP

2002-12-10 Thread Robert Citek
Hello Mike, The short answer: use Perl, Python, Ruby, etc. You are pressing the boundaries between a query language (SQL) and a programming/scripting language (Perl, Python, Ruby, etc.). Scripting languages as these already have those capabilities and can easily connect to MySQL an many other