Plotdata Capture with Regex
Yet Another Terminal :: Serial Communication :: Engineer/Test/Debug
Brought to you by:
maettu_this,
y-a-terminal
My device outputs lines like below
79.2%(79.2%), V=4072mV, I=5mA, T=39.0C, ChVal=1425, RemTime=123
I was wondering if /(?<=ChVal\=)(\d+)/g kinda regex would capture my ChVal value and plot it (well that regex didn't work for sure). Otherwise can someone explain how plotdata is sourced from the filter?
The regex can be simplified to
ChVal=(\d+)
. While this may not be good enough for other cases, it should be good enough for this particular case.Note that YAT uses the .NET regex flavour, matched by http://regexstorm.net/tester. But that site is quite limited in features. So I only use it to verify .NET compatibility. I prefer using https://regex101.com/, alternatively https://regexr.com/ which works fine as well.
See attached screenshot how I could successfully plot using this regex.
Beautiful. Thank you so much! Oh this is gonna make live battery life / voltage fluctuation measurements incredible.