It is currently April 27th, 2024, 10:37 pm

Help needed with RegExps counting whitespaces...

General topics related to Rainmeter.
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Help needed with RegExps counting whitespaces...

Post by Kyremi »

jsmorley wrote:You need to turn off "line wrapping" in your text editor, so you can be sure it is all on one line. Many if not most editors will make it "look" like it is on separate lines by wrapping it in the editor, but you want to be sure it isn't actually chopping it into separate lines.
I turned off Word Wrapping in notepad and now it's definitely one long line... but I still get the same error on refresh...

edit: found the problem, there was an extra space hidden somewhere in that huge line of regexp :P
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help needed with RegExps counting whitespaces...

Post by jsmorley »

There is some error in that RegExp, even after I get it all on one line. I'm not sure where, but somewhere there is a missing space, or a comma instead of a period, or something. I get a matching error as well, unless I cut it down to just the first 10 or so.

Edit: Good deal.
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Help needed with RegExps counting whitespaces...

Post by Kyremi »

It's certainly annoying when there's a hugely long line and I have to find the one silly space that got away :P I fast-forwarded this by pasting the line into Word, where the spaces are a lot more obvious, and fixing them there, then pasting them back in. So, for now, this works :) Thanks for all the help :D I'll probably find more problems and require more assistance later though...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help needed with RegExps counting whitespaces...

Post by jsmorley »

Kyremi wrote:It's certainly annoying when there's a hugely long line and I have to find the one silly space that got away :P I fast-forwarded this by pasting the line into Word, where the spaces are a lot more obvious, and fixing them there, then pasting them back in. So, for now, this works :) Thanks for all the help :D I'll probably find more problems and require more assistance later though...
Good job. Glad to help.
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Help needed with RegExps counting whitespaces...

Post by Kyremi »

Is there a way to replace underscore characters with a whitespace character? One of the bits of data I grab is a current weather situation description, and some of them have a _, e.g. Night_time. Is there a way to tell the string meter to write that as whitespace?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help needed with RegExps counting whitespaces...

Post by jsmorley »

Kyremi wrote:Is there a way to replace underscore characters with a whitespace character? One of the bits of data I grab is a current weather situation description, and some of them have a _, e.g. Night_time. Is there a way to tell the string meter to write that as whitespace?
Sure. On the child measure returning that value, put:

Substitute="_":" "

That will replace all underscores with spaces in that result.