Oracle regex match whitespace

后端 未结 1 1261
既然无缘
既然无缘 2020-12-11 22:18

I\'m trying to change a value in oracle with regex:

input: 13/10/2016  10:10:10
output: 13/10/2016  10:10:10
         


        
相关标签:
1条回答
  • 2020-12-11 22:51

    Since the \s is a Perl-like construct and Oracle regex is POSIX based, it is safer to use the POSIX character class [:space:] (to include vertical whitespace) or [:blank:] (to only match spaces and tabs).

    E.g. use

    ([[:space:]0-9/:]+)
    

    Remember to always use POSIX character classes inside bracket expressions (so, to match one alpha character, use [[:alpha:]], i.e. the name of the class must be inside colons and double square brackets).

    0 讨论(0)
提交回复
热议问题