Skip to main content
added 4 characters in body
Source Link
Balazs Papp
  • 41.1k
  • 2
  • 28
  • 47
with data as
(
  select 'AD-892839 statement' as text               from dual union all
  select 'BOD AD-89283'                              from dual union all
  select 'BOD AD-89283 ACGD'                         from dual union all
  select 'BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD' from dual union all
  select 'AD-89283/1,AD-89284/2,AD-89285/1 TIOL'     from dual
)
select regexp_substr(data.text, '(AD-([[:digit:]]|/)+|,)+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'(AD-([[:DIGIT:]]
-----------------------------------------
AD-892839
AD-89283
AD-89283
AD-89283/1,AD-89284/2,AD-89285/1
AD-89283/1,AD-89284/2,AD-89285/1
with data as
(
  select 'AD-892839 statement' as text               from dual union all
  select 'BOD AD-89283'                              from dual union all
  select 'BOD AD-89283 ACGD'                         from dual union all
  select 'BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD' from dual union all
  select 'AD-89283/1,AD-89284/2,AD-89285/1 TIOL'     from dual
)
select regexp_substr(data.text, '(AD-([[:digit:]]|/)+|,)+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'(AD-([[:DIGIT:]]
-----------------------------------------
AD-892839
AD-89283
AD-89283
AD-89283/1,AD-89284/2,AD-89285/1
AD-89283/1,AD-89284/2,AD-89285/1
with data as
(
  select 'AD-892839 statement' as text               from dual union all
  select 'BOD AD-89283'                              from dual union all
  select 'BOD AD-89283 ACGD'                         from dual union all
  select 'BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD' from dual union all
  select 'AD-89283/1,AD-89284/2,AD-89285/1 TIOL'     from dual
)
select regexp_substr(data.text, '(AD-([[:digit:]]|/)+|,)+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'(AD-([[:DIGIT:]]
-----------------------------------------
AD-892839
AD-89283
AD-89283
AD-89283/1,AD-89284/2,AD-89285/1
AD-89283/1,AD-89284/2,AD-89285/1
with data as
(
  select 'AD-892839 statement' as text               from dual union all
  select 'BOD AD-89283'                              from dual union all
  select 'BOD AD-89283 ACGD'                         from dual union all
  select 'BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD' from dual union all
  select 'AD-89283/1,AD-89284/2,AD-89285/1 TIOL'     from dual
)
select regexp_substr(data.text, 'AD'(AD-([[:digit:]]+']]|/)+|,)+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'AD'(AD-([[:DIGIT:]]+')]]
--------------------------------------------------------------------------
AD-892839
AD-89283
AD-89283989283
AD-89283/1,AD-89284/2,AD-89285/1
AD-89283/1,AD-89284/2,AD-89285/1
with data as
(
  select 'AD-892839 statement' as text from dual union all
  select 'BOD AD-89283'                from dual union all
  select 'BOD AD-89283 ACGD'           from dual
)
select regexp_substr(data.text, 'AD-[[:digit:]]+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'AD-[[:DIGIT:]]+')
----------------------------------------------------------------------------
AD-892839
AD-89283
AD-89283
with data as
(
  select 'AD-892839 statement' as text               from dual union all
  select 'BOD AD-89283'                              from dual union all
  select 'BOD AD-89283 ACGD'                         from dual union all
  select 'BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD' from dual union all
  select 'AD-89283/1,AD-89284/2,AD-89285/1 TIOL'     from dual
)
select regexp_substr(data.text, '(AD-([[:digit:]]|/)+|,)+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'(AD-([[:DIGIT:]]
-----------------------------------------
AD-892839
AD-89283
AD-89283
AD-89283/1,AD-89284/2,AD-89285/1
AD-89283/1,AD-89284/2,AD-89285/1
Source Link
Balazs Papp
  • 41.1k
  • 2
  • 28
  • 47

with data as
(
  select 'AD-892839 statement' as text from dual union all
  select 'BOD AD-89283'                from dual union all
  select 'BOD AD-89283 ACGD'           from dual
)
select regexp_substr(data.text, 'AD-[[:digit:]]+')
from data;

REGEXP_SUBSTR(DATA.TEXT,'AD-[[:DIGIT:]]+')
----------------------------------------------------------------------------
AD-892839
AD-89283
AD-89283