Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

Problem with Regular Expressions and Templating

$
0
0

@Prokktor wrote:

Hi,

I have values like this:
AA B1 03 04C4 0186 30F2 28190908190909090908190819090908190908190819090819 55

And I need only the longest word in this “sentence”, so I tried Regular Expressions:
‘value_template: "{{value_json.RfReceived.Data | regex_findall_index(’\S{20,}’)}}"’

But I get an error (HA does not understand the escaped S)

I tried the solution for this related problem in the template editor:

But HA says unknown error while parsing… even if I copy the suggested solution char by char

I then read the jinja docs but no other solution was obvious to me…

Thanks for your time!

Regards

Martin

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>