felixhageloh / uebersicht

ˈyːbɐˌzɪçt
GNU General Public License v3.0
4.58k stars 165 forks source link

Error in SED -e regex can block Uebersicht #76

Open TraderStf opened 9 years ago

TraderStf commented 9 years ago

Try changing the regex, making mistakes... sometimes, the output will be just "s/...." correct/restore it, the news are updated. Sometimes UBS will be frozen, must quit and restart it.

command: "curl -sf api.breakingnews.com/api/v1/item/?format=rss | grep -o '[^<]*' | sed -e 's/.*\\\(.*\\)\<\\/title\>.*/

— \\1<\\/p>/g'" refreshFrequency: 60000 style: """ top: 60px left: 60px max-width: 256px max-height: 558px overflow: hidden color: #aaa """

kiambogo commented 8 years ago

I realize this thread is very old, but I'm also experiencing this.

Looking at the debug console, it appears that this is when we use sed to perform a regex replace. sed -e 's/.*"CAD":\([0-9]*.[0-9]*\).*$/\1/g' is what I have, and I receive an error on the escaped \1 : ParseError: octal escape sequences are not allowed \1

Is there a way to use sed to perform regex replace like this?

felixhageloh commented 7 years ago

unfortunately it is a known issue with coffeescript. You can circumvent it by using

command: "sed -e 's/.*\"CAD\":\([0-9]*.[0-9]*\).*$/\#{1}/g'"

i.e. interpolating the 1 by using #{1}