You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "anci_sun@yahoo.com" <an...@yahoo.com> on 2018/11/12 11:02:02 UTC

Rlike '\s' couldn't get the space

Dears,
    I see that using '\s' can get the whitespace character in normal java  regular expressions, but in HIVE I found it couldn't. 
    Why? And is there any other differences between the regular expressions in JAVA and HIVE?
    



Regards,
    孙志禹

Re: Re: Rlike '\s' couldn't get the space

Posted by 孙志禹 <an...@yahoo.com>.
It did help, thanks!



Regards,
    孙志禹
 
From: Tanvi Thacker
Date: 2018-11-15 06:06
To: user
Subject: Re: Rlike '\s' couldn't get the space
Hi,

You need to use "rlike '\\s'  to escape the single backslash.

Regards
Tanvi Thacker

On Mon, Nov 12, 2018 at 3:02 AM anci_sun@yahoo.com <an...@yahoo.com> wrote:
Dears,
    I see that using '\s' can get the whitespace character in normal java  regular expressions, but in HIVE I found it couldn't. 
    Why? And is there any other differences between the regular expressions in JAVA and HIVE?
    



Regards,
    孙志禹

Re: Rlike '\s' couldn't get the space

Posted by Tanvi Thacker <ta...@gmail.com>.
Hi,

You need to use "*rlike '\\s' * to escape the single backslash.

Regards
Tanvi Thacker

On Mon, Nov 12, 2018 at 3:02 AM anci_sun@yahoo.com <an...@yahoo.com>
wrote:

> Dears,
>     I see that using '\s' can get the whitespace character in normal java  regular expressions,
> but in HIVE I found it couldn't.
>     Why? And is there any other differences between the regular
> expressions in JAVA and HIVE?
>
>
> ------------------------------
> Regards,
>     孙志禹
>