# REGEX and multiple Serial bindings on same port

**URL:** <https://community.openhab.org/t/regex-and-multiple-serial-bindings-on-same-port/12197>\
**Category:** Items & Sitemaps\
**Created:** [July 6, 2016, 3:26pm UTC](https://community.openhab.org/t/regex-and-multiple-serial-bindings-on-same-port/12197 "2016-07-06T15:26:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![informer](https://community.openhab.org/letter_avatar_proxy/v4/letter/i/8e8cbc/32.png) [@informer](https://community.openhab.org/u/informer)\
**Post date:** [July 6, 2016, 3:26pm UTC](https://community.openhab.org/t/regex-and-multiple-serial-bindings-on-same-port/12197/1 "2016-07-06T15:26:15Z")

</div>

Hello,  
I have a question related to REGEX usage for serial binding.

I receive on same serial port different packets containing different values from different sensors.  
Packet type can be identified by the second and third char from the beginning of the packet:

temperature: \<28_Sensor\_id,data etc…\>  
pressure: \<11_Sensor\_id,data etc…\>  
humidity: \<12\*Sensor\_id,data etc…\>

I created three items as follows:

```
String tempExt	"Temperatura exterioara" (Senzori)	{ serial="/dev/ttyUSB0@9600,REGEX(<28\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{6}).*)" }
String presExt	"Presiune exterioara" (Senzori)	{ serial="/dev/ttyUSB0@9600,REGEX(<11\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{5}).*)" }
String umid	"Umiditate" (Senzori)	{ serial="/dev/ttyUSB0@9600,REGEX(<12\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{4}).*)" }

```

The MATCHING works for one sensor but all the other are updated with the whole string!!!

presExt state updated to 753.8  
tempExt state updated to \<11_0_032_30000003EBD18228_753.8 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\>  
umid state updated to \<11_0_032_30000003EBD18228_753.8 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\>

Is it not possible to update a string item ONLY if the REGEX matches?
