Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: K4thos
« on: September 21, 2016, 12:21:01 AM »

Quote
From earlier discussions, I think the regexp matching is entirely handled by OCaml.  In their flavour of regexp, the $ symbol matches before LF but not before CR.
Damn, it was me who started that discussion like a year ago with almost the exact same question. How on earth I forgot about it (and made regression in EET due to it) is beyond me :o
Posted by: Mike1072
« on: September 20, 2016, 08:04:47 PM »

From earlier discussions, I think the regexp matching is entirely handled by OCaml.  In their flavour of regexp, the $ symbol matches before LF but not before CR.
Posted by: K4thos
« on: September 20, 2016, 02:51:33 PM »

ah, indeed. I even used something like this at some point to make end of line detectable (or maybe it was the other way around):
Code: [Select]
REPLACE_TEXTUALLY ~%WNL%~ ~%LNL%~Completely forgot about it. Thanks.

So, Wisp, any chance to make $ special character to work with both %LNL% and %WNL%? It's not really crucial since my usage of $ in code was excessive either way but maybe worth considering if it's not much of work,
Posted by: Argent77
« on: September 20, 2016, 02:37:03 PM »

FILE_CONTAINS_EVALUATED doesn't appear to like the end-of-line matcher '$' in regular expressions.
Posted by: K4thos
« on: September 20, 2016, 01:33:53 PM »

Not sure if it's a bug or if I didn't understood weidu documentation. This test code:
Code: [Select]
ACTION_IF (NOT FILE_CONTAINS_EVALUATED (~GTIMES.IDS~ ~[ %TAB%]ONE_MINUTE[ %TAB%]*$~)) BEGIN
PRINT ~regexp not recognized~
END
prints the message as if the ONE_MINUTE was not present within GTIMES.IDS. This code:
Code: [Select]
ACTION_IF (NOT FILE_CONTAINS_EVALUATED (~GTIMES.IDS~ ~ ONE_MINUTE~)) BEGIN
PRINT ~regexp not recognized~
END
works fine (message not printed)

And according to documentation:
Quote
FILE_CONTAINS_EVALUATED ( fileName varsRegexp )
First, all WeiDU variables enclosed in %s in varsRegexp and fileName are substituted. The expression is 1 if the resulting regexp occurs in fileName and 0 otherwise. If fileName does not exist or has size 0, the result is 0. The comparison ignores case.