pig-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mridul Muralidharan <mrid...@yahoo-inc.com>
Subject Re: matches with regular expression in pig
Date Fri, 03 Dec 2010 10:11:33 GMT

That is a very nice tip, thanks !

Regards,
Mridul

On Friday 03 December 2010 02:49 PM, Anze wrote:
>
> You could also try 'abc[|].*'. I find it is often easier (and less error-
> prone) to use this principle than it is to escape the escaping character... :)
>
> Just be careful with '-', it must be at the end. And it doesn't work with ']',
> unless you escape it (I guess; I've never needed this).
>
> Regards,
>
> Anze
>
>
> On Friday 03 December 2010, Jeff Zhang wrote:
>> Use 'abc\\|.*', '\' is also a special character in java that should
>> been escaped.
>>
>> On Fri, Dec 3, 2010 at 11:34 AM, Zhen Guo<zhguo1@gmail.com>  wrote:
>>> Hi all,
>>>
>>> In pig, we can do pattern matching with regular expression. For a pattern
>>> like "abc|.*", how to write the regular expression?
>>>
>>> I tried the following:
>>>
>>> A = FILTER B BY (name matches 'abc\|.*');
>>>
>>> but it does not work. I cannot use 'abc|.*' because it will match
>>> anything.
>>>
>>> Any ideas are appreciated.
>>>
>>> Thanks,
>>>
>>> Zhen
>


Mime
View raw message