मैं REGEXP_SUBSTR का उपयोग करूंगा (दस्तावेज़ीकरण
), सही नियमित अभिव्यक्तियों के साथ। उदाहरण के लिए:
select regexp_substr('Chapter 18 Unit 10 Sect 16', 'Chapter \d*') from dual;
--Will return: Chapter 18
select regexp_substr('Chapter 18 Unit 10 Sect 16', 'Unit \d*') from dual;
--Will return: Unit 10
select regexp_substr('Chapter 18 Unit 10 Sect 16', 'Sect \d*') from dual;
--Will return: Sect 16
बेशक अगर आप Chapter xx Unit yy Sect zz . स्टोर करते हैं तालिका में तार, तो आप कई परिणाम प्राप्त करने के लिए बस इस तरह की क्वेरी का उपयोग करते हैं:
select regexp_substr(info_column, 'Chapter \d*') from mytable;
आप \d . को बदल सकते हैं [0-9] . के साथ या [[:digit:]]