select case when 'DR DREW J' regexp '^SR\s.*' then 'Y' else 'N' end;
Result: 'Y'
s/b 'N'. Works correctly with: select case when 'DR DREW J' regexp '^TR\s.*' then 'Y' else 'N' end; Result: 'N' select case when 'DR DREW J' regexp '^sR\s.*' then 'Y' else 'N' end; Result: 'N' select case when 'DR DREW J' regexp '^DR\s.*' then 'Y' else 'N' end; Result: 'Y' |
I have confirmed that this is a bug in SQL Anywhere's REGEXP processing for ^. I believe this bug affects all versions for SQL Anywhere 11 and 12. In this context, the ^ is unnecessary, since REGEXP matches the whole string. As a work around, you can remove the unnecessary ^ from the regular expression and the regular expression matching should behave correctly. I have created engineering issue 721070 to track this issue and I will post an update once I know what build numbers will contain the fix. 2
The fix for this issue will appear in 12.0.1.3803 (or higher) as well as 11.0.1.2885 (or higher).
(09 Oct '12, 17:09)
Ian McHardy
|
12.0.0.2483 is really an old version (was it the v12 GA) - I would test with a current 12.0.1 EBF (or read the according EBF readme) to see if this is corrected... cf. Breck's according list here...