List:General Discussion« Previous MessageNext Message »
From:Murad Nayal Date:November 21 2002 1:48pm
Subject:extracting submatches from regular expressions
View as plain text  

Hello all,

Is there a mysql function that extracts sub matches from regular
expressions. for example in perl when you match a string to a regular
expression like /\s+(\S+)\s+(\S+)/ the submatches (strings matching the
part of the expression between parenthesis) are available in variables
$1, $2 etc. after the match. It would have been really useful if you
could do that in sql. something like: 

select submatch(column,regular_expression) from table where condition

I couldn't find a mention of such function in the manual but I thought
I'd ask.

BTW, does any other DBMS implement such function.

many thanks

Murad Nayal
mysql query errorck nuke21 Nov
  • Re: mysql query errorDan Nelson21 Nov
  • extracting submatches from regular expressionsMurad Nayal21 Nov