REGEX problem in http binding

I have this item configuration:
Number Solar_Leistung "Solar [%d W]" <sun> (Solar) {http="<[http://192.168.178.220/min_day.js:60000:REGEX((?<=\\|)(\\d*)(?=\\;))]"}

I get this log:
7:57:51.127 INFO runtime.busevents[:26] - Solar_Leistung state updated to m[mi++]="14.02.16 17:10:00|0;0;0;964;226;226;21" m[mi++]="14.02.16 17:05:00|0;0;0;964;256;256;22" m[mi++]="14.02.16 17:00:00|0;0;0;964;274;274;22" m[mi++]="14.02.16 16:55:00|0;0;0;964;264;264;22" m[mi++]="14.02.16 16:50:00|0;0;0;964;259;259;22"

I’m trying to match only the first line and the number between | and ; which is currently 0. I tested my regex on http://www.regexplanet.com/advanced/java/index.html and it looked fine to me.

Any advice would be great.

Something with one capture value, more like:

.*?\|(\d+);.*

… or the Java-escaped variant :wink:

REGEX adds a ^ and $ to the beginning/end (resp) of the string supplied, so this will only catch the first value.

EDIT: Here’s an example of it in rule form:

rule "test regex 4"
when
   Time cron "0/10 * * * * ?"
then
   var VALUE = 'm[mi++]="14.02.16 17:10:00|0;0;0;964;226;226;21"\nm[mi++]="14.02.16 17:05:00|0;0;0;964;256;256;22"\nm[mi++]="14.02.16 17:00:00|0;0;0;964;274;274;22"\nm[mi++]="14.02.16 16:55:00|0;0;0;964;264;264;22"\nm[mi++]="14.02.16 16:50:00|0;0;0;964;259;259;22"'

   logInfo('regex4', 'original=' + VALUE + ' new=' + transform('REGEX', '.*?\\|(\\d+);.*', VALUE))
end

and the output:

10:21:30.005 DEBUG o.o.m.r.i.e.ExecuteRuleJob[:53]- Executing scheduled rule 'test regex 4'
10:21:30.012 DEBUG o.o.c.t.i.s.RegExTransformationService[:42]- about to transform 'm[mi++]="14.02.16 17:10:00|0;0;0;964;226;226;21"
m[mi++]="14.02.16 17:05:00|0;0;0;964;256;256;22"
m[mi++]="14.02.16 17:00:00|0;0;0;964;274;274;22"
m[mi++]="14.02.16 16:55:00|0;0;0;964;264;264;22"
m[mi++]="14.02.16 16:50:00|0;0;0;964;259;259;22"' by the function '.*?\|(\d+);.*'
10:21:30.015 INFO  o.openhab.model.script.regex4[:53]- original=m[mi++]="14.02.16 17:10:00|0;0;0;964;226;226;21"
m[mi++]="14.02.16 17:05:00|0;0;0;964;256;256;22"
m[mi++]="14.02.16 17:00:00|0;0;0;964;274;274;22"
m[mi++]="14.02.16 16:55:00|0;0;0;964;264;264;22"
m[mi++]="14.02.16 16:50:00|0;0;0;964;259;259;22" new=0

Thanks, it is working in my .item file now.