regexp-substr

Extract date from string oracle

让人想犯罪 __ 提交于 2019-11-27 08:52:34
问题 I have a column in which a string starts with - 'Chicago, IL, April 20, 2015 — and so on text here'. I want to extract the Date part from this string in Oracle. Any ideas on how to do this. I was able to find something for mm/dd/yyyy like below, but not for long date format. SELECT REGEXP_SUBSTR(' the meeting will be on 8/8/2008', '[0-9]{1,}/[0-9]{1,}/[0-9]{2,}') FROM dual 回答1: If your columns value is always start with 'Chicago, IL, April 20, 2015 — and so on text here' then you could simly

How can I use regex to split a string, using a string as a delimiter?

笑着哭i 提交于 2019-11-27 07:12:55
问题 I'm trying to split a string using a string as a delimiter, in an Oracle store procedure. I can use instr easily, but I'm trying to learn how to do this with regex, as I understand that it is powerful and efficient. After reading some articles, I thought I could do this (expected result was " Hello "): select regexp_substr('Hello My Delimiter World', '( My Delimiter )+', 1, 1) from dual Result: My Delimiter and (expected result was " World "): select regexp_substr('Hello My Delimiter World',

Split string by space and character as delimiter in Oracle with regexp_substr

随声附和 提交于 2019-11-26 17:19:08
问题 I'm trying to split a string with regexp_subtr, but i can't make it work. So, first, i have this query select regexp_substr('Helloworld - test!' ,'[[:space:]]-[[:space:]]') from dual which very nicely extracts my delimiter - blank - blank But then, when i try to split the string with this option, it just doesn't work. select regexp_substr('Helloworld - test!' ,'[^[[:space:]]-[[:space:]]]+')from dual The query returns nothing. Help will be much appreciated! Thanks 回答1: SQL Fiddle Oracle 11g R2