You can use regexp_replace to remove all that doesn't match your pattern.
with t (col) as (
select 'My twwet #HashTag1 and this is the #SecondHashtag sample, #onemorehashtag'
from dual
)
select
regexp_replace(col, '(#\S+\s?)|.', '\1')
from t;
Produces;
#HashTag1 #SecondHashtag #onemorehashtag
regexp_substr will return one match. What you can do is turn your string into a table using connect by:
with t (col) as (
select 'My twwet #HashTag1 and this is the #SecondHashtag sample, #onemorehashtag'
from dual
)
select
regexp_substr(col, '#\S+', 1, level)
from t
connect by regexp_substr(col, '#\S+', 1, level) is not null;
Returns:
#HashTag1
#SecondHashtag
#onemorehashtag
EDIT:
\S matches any non space character. It would be better to use \w which matches a-z, A-Z, 0-9 and _.
As commented by @mathguy and from this site:
a hashtag starts with an alphabet, then alphanumeric characters or underscores are allowed.
So, pattern #[[:alpha:]]\w* will work better.
with t (col) as (
select 'My twwet #HashTag1, this is the #SecondHashtag. #onemorehashtag'
from dual
)
select
regexp_substr(col, '#[[:alpha:]]\w*', 1, level)
from t
connect by regexp_substr(col, '#[[:alpha:]]\w*', 1, level) is not null;
Produces:
#HashTag1
#SecondHashtag
#onemorehashtag