Title: How to extract everything after 1st series of numbers PL/SQL
Tags: sql;regex;oracle;regexp-substr
Question: I want to extract everything after the 1st series of numbers.
For example, the outcome of 95a6 should be 95 and a6.
And the outcome of 9B2 should be 9 and B2

Comment: The value is in 1 field, for example 263C2.
The outcome I want is are 2 values in 2 fields, which would be 263 in one field and C2 in the other field.

Comment: Huh?  Are you returning one value or two values?  How are you getting "95"?

Here is the accepted answer: You can use ```REGEXP_SUBSTR``` for this:

```SELECT str
     , REGEXP_SUBSTR(str, '\d+') AS substr1
     , REGEXP_SUBSTR(str, '[A-Za-z].*') AS substr2
FROM (
    SELECT '95a6' AS str FROM DUAL UNION
    SELECT '9 B2' FROM DUAL
) tests
```

Here ```\d+``` matches a sequence of digits and ```[A-Za-z].*``` matches a letter and everything after it.

Demo on db<>fiddle

Comment for this answer: And how can I remove all white spaces, if there is any?
Comment for this answer: If I use trim it removes the white spaces but when I use REGEXP_SUBSTR to divide the column into 2 columns it still has white spaces.

For example:

the original input, which is 1 field, 95 a6 ----> output is '95' and ' a6'.
So still with whitespace
Comment for this answer: You could simply `TRIM` the string before matching. Be advised that this is a very simple regex designed only to handle the examples you provided.
Comment for this answer: @bhr... my bad... TRIM ***after*** REGEXP_SUBSTR i.e. `TRIM(REGEXP_SUBSTR(...))`. Having said that, I recently added another example in my answer. Or change the second regexp from `\D.*` to `[a-zA-Z].*`. Lots of possible workarounds.
Comment for this answer: Can you explain please the difference between \d and \D ? and why you added `.` ?


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:01/18/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<sql><regex><oracle><regexp-substr>', 'Title': 'How to extract everything after 1st series of numbers PL/SQL', 'ViewCount': 66, 'id': 54254605, 'user_AboutMe': '<p>Computer Science student</p>\n', 'user_AccountId': 12596423.0, 'user_DisplayName': 'bhr', 'user_Reputation': 397.0, 'user_Views': 48.0, 'user_id': 9160869.0}}