0

string: From_the_filename_pick_MONTH_YYYY.csv , desired output: MONTH YYYY , Tried and achieved result using combination of INSTR , SUBSTR and REPLACE

How can I do this using regular expression?

Jin
  • 11
  • 2
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/questions/4736) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Oct 07 '20 at 11:56

1 Answers1

-1

One method uses regexp_substr():

select replace(regexp_substr('From_the_filename_pick_MONTH_YYYY.csv', '[^_]+_[^._]+[.]'), '.', '')
from dual;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786