1

Anyone have a suggestion how I might be able to write a REGEXP in SQLITE that uses the same functionality as \K in say Teradata.

Example:

text = "height"=>"5","xxxxxxxxxxx"

Regexp:

SELECT * FROM xxxxx where xxxxx = 'xxxxxxx'and xxxxxx 
where REGEXP '"height".+?"\K\d+' 

This returns the integer 5.

This regepx works fine in Teradata but not SQLITE. I am using DB Browser (SQLite)

Thanks in advance.

The fourth bird
  • 154,723
  • 16
  • 55
  • 70
Banana
  • 11
  • 2

1 Answers1

0

Got it sorted, instead of a regexp my boss (smart cookie) suggested I do the following:

Update XXXXX
Set height = Case when instr(XXXXXXX,'"height"=>"') > 0
then substr(XXXXXXX,instr(XXXXXXXs,'"height"=>"')+11,instr(substr(XXXXXXX,instr(XXXXXXX,'"height"=>"')+11,5),'"')-1)
else ''
end
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Banana
  • 11
  • 2