OH2: Help needed to parse HTML ... REGEX error

Hi,

I’m trying to use an “advanced” regex in the http binding without success.
Here is my item defintion:

String PAC_Data  "PAC "	{ http="<[PAC-request:30000:REGEX(<form[^>]*>((.|[\n\r])*)<\/form>)]"}

In the log file, the following error is find:

2016-11-19 18:52:22.670 [WARN ] [.internal.HttpGenericBindingProvider] - bindingConfig is NULL (item=PAC_Data (Type=StringItem, State=Uninitialized)) -> process bindingConfig aborted!

If I use a simple REGEX like (.*) the full html file is correctly loaded.

I’ve also tried a rule with the REGEX but a script error occured.
Here is the rule:

rule "PAC info"
when 
Item PAC_Data received update
then
logInfo("logInfoPAC"," PAC updated")

var String request = PAC_Data.state.toString
//logInfo("logInfoPAC", request)

var String result = transform("REGEX","<form[^>]*>((.|[\n\r])*)<\/form>/im" ,request)
logInfo("logInfoPAC","result " + result)

end

and the script Error:

2016-11-19 18:49:48.924 [INFO ] [se.smarthome.model.script.logInfoPAC] -  PAC updated
2016-11-19 18:49:48.931 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'PAC info': null

Do you have any idea on the way to use this REGEX? For information, I’ve successfully validatedthe REGEX with the online tool : https://regex101.com/

After several hours, I’m totally out of good idea :slight_smile:
Thank you for your help