от:
'MID: 124281-2 - SID: 31701'
регулярное выражение, чтобы получить 124281-2 только:
[0-9]{1,6}-[0-9]
описание:
[0-9]{1,6} match a single character present in the list below
Quantifier: Between 1 and 6 times, as many times as possible, giving back as
needed.
0-9 a single character in the range between 0 and 9
- matches the character - literally
[0-9] match a single character present in the list below
, если ограничение для пожелавших символов между ':' и '-' вы можете использовать следующее регулярное выражение:
(?<=:\s)[^,]+(?=\s-)
Описание:
(?<=:\s) Positive Lookbehind - Assert that the regex below can be matched
: matches the character : literally
\s match any white space character [\r\n\t\f ]
[^,]+ match a single character not present in the list below
Quantifier: Between one and unlimited times, as many times as possible,
giving back as needed.
, the literal character ,
(?=\s-) Positive Lookahead - Assert that the regex below can be matched
\s match any white space character [\r\n\t\f ]
- matches the character - literally
надеюсь, что это помогает.
'select regexp_substr (mid_sid_column, '\ d [0-9 -] *', 1, 1) как mid, regexp_substr (mid_sid_column, '\ d [0-9 -] *', 1, 2) как sid из таблицы' –
@Egor, спасибо, это работает :) – Ianthe