# Filtering nodes do not support multi-language character sets

**URL:** <https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265>\
**Category:** CloverDX Platform\
**Created:** [January 4, 2008, 12:00am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265 "2008-01-04T00:00:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 4, 2008, 12:00am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/1 "2008-01-04T00:00:00Z")

</div>

Filtering nodes do not support regular expressions are intended to characters in the \ w \ s, and so on, does not support multi-language character sets.

eg.  
$Field1 ~= “^[0-9]\w.\*”  
substring($Field2,0,2) == “黄威”

Can support?

---

<div class="post-metadata">

**Author:** ![dpavlis](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dpavlis](https://forum.cloverdx.com/u/dpavlis)\
**Post date:** [January 6, 2008, 11:26am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/2 "2008-01-06T11:26:40Z")

</div>

Can you try to use unicode escape sequence in place of the characters (both for the **regex** and the **substring** ) ?

Also, I am not sure what problem are you describing - is it that 黄威 are not recognized as \w ?

Sorry, I am not familiar with Asian alphabets and need a hint here.

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 7, 2008, 7:50am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/3 "2008-01-07T07:50:55Z")

</div>

table structure:  
create table t1 (f1 varchar(50), f2 varchar(50));

record content:  
黄威 20071976北京  
huangwei 20071976beijing

extFilter node expression:  
$f2 ~= ‘^[0-9]{8}[a-z]\*’

outPort (0) output record  
huangwei 20071976beijing

outPort (1) output record  
黄威 20071976北京  
----------------------------------------------------------  
I want outPort (0) to output content below  
黄威 20071976北京  
----------------------------------------------------------

extFilter node expression:  
$f2 ~= ‘^[0-9]{8}\p{InHanzi}\*’  
output error info:  
ERROR [WatchDog] - EXT\_FILTER\_0 …FAILED !  
Parser error when parsing expression: Encountered “\'^[0-9]{8}” at line 1, column

1. 

Was expecting:  
\<STRING\_LITERAL\> …

extFilter node expression:  
substring($f3,8,2)==‘北京’

outPort (0) output record 0  
outPort (1) output record 2  
黄威 20071976北京  
huangwei 20071976beijing

---

<div class="post-metadata">

**Author:** ![dpavlis](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dpavlis](https://forum.cloverdx.com/u/dpavlis)\
**Post date:** [January 7, 2008, 8:46am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/4 "2008-01-07T08:46:58Z")

</div>

If you use \ (backslash) in your regex string in transform language, you have to escape it - like this:

```auto

$f2 ~= '^[0-9]{8}\\\\p{InHanzi}*'

```

The reason why is that the backslash gets preprocessed twice - first when the expression is read from XML and \\ is preprocess to \ and then again the TL language parser preprocesses \\ to \ - then it gets to Java’s regex evaluator.

We will try to fix this nuisance (in 2.3.x and earlier) in next release of Clover.

I will check the rest of the problem too, but check the updated expression above.

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 7, 2008, 9:19am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/5 "2008-01-07T09:19:29Z")

</div>

ERROR [WatchDog] - EXT\_FILTER\_0 …FAILED !  
Error when parsing expression: Illegal repetition near index 11  
^[0-9]{8}\\p{InHanzi}\*

--------------------------------

substring($f2,8,2)==‘北京’

Substring function Why not support the “北京”?

---

<div class="post-metadata">

**Author:** ![dpavlis](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dpavlis](https://forum.cloverdx.com/u/dpavlis)\
**Post date:** [January 7, 2008, 9:30am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/6 "2008-01-07T09:30:41Z")

</div>

Well,interesting problem with the regex… I will see to it …

As for the substring - try to use unicode escape (\uxxxx) in place of the two chars - you will have to find their unicode numbers.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [January 7, 2008, 12:03pm UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/7 "2008-01-07T12:03:27Z")

</div>

I’ve found that such regex does not throw an exception:  
“^[0-9]{8}[\\p{InHanzi}]\*”

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 8, 2008, 2:47am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/8 "2008-01-08T02:47:52Z")

</div>

Thank you for your response,Substring function issue has been resolved

---

<div class="post-metadata">

**Author:** ![dpavlis](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dpavlis](https://forum.cloverdx.com/u/dpavlis)\
**Post date:** [January 8, 2008, 9:35am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/9 "2008-01-08T09:35:50Z")

</div>

Cool,  
can I ask you how did you solve it ?

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 9, 2008, 12:48am UTC](https://forum.cloverdx.com/t/filtering-nodes-do-not-support-multi-language-character-sets/265/10 "2008-01-09T00:48:18Z")

</div>

Solutions to the inconvenient, the process is this.

1. 

D:\javasoft\Jdk1.5.0\_04\bin\>native2ascii  
北京  
\u5317\u4eac

1. 

extFilter node expression:  
substring($f2,8,2)==‘\u5317\u4eac’

====================================  
extFilter node expression:  
$f2 ~= ‘^[0-9]{8}[\u4e00-\u9fa5]\*’

[\u4e00-\u9fa5] On behalf of the Asian Regional Character Set,This realization is some trouble
