WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: JTaylor on May 29, 2024, 06:24:54 AM

Title: $" - Line Continuation Bug?
Post by: JTaylor on May 29, 2024, 06:24:54 AM
If you run the following and paste the results you will find that a blank space has been inserted at the end of each line.   Should that be occurring?

Jim


ps = $"^\d{4}-\d{2}-\d{2};
^(3[01]|[12][0-9]|0?[1-9])(\/|-)(1[0-2]|0?[1-9])\2([0-9]{2})?[0-9]{2}$;
(0[1-9]|1[1,2])(\/|-)(0[1-9]|[12][0-9]|3[01])(\/|-)(19|20)\d{2};
(0[1-9]|[12][0-9]|3[01])(\/|-)(0[1-9]|1[1,2])(\/|-)(19|20)\d{2};
^\d{1}/\d{2}/\d{4}$;
^\d{2}.\d{2}.\d{4}$;
^(January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2},\s\d{4}$;
^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{1,2},\s\d{4}$;
^\d{1}-\d{2}-\d{4}$$"

clipput(ps)
Title: Re: $" - Line Continuation Bug?
Post by: td on May 29, 2024, 06:43:45 AM
Yes. This has been discussed multiple times on this forum. If you don't like it, set your editor to use line feeds as line terminators instead of carriage return line feeds.
Title: Re: $" - Line Continuation Bug?
Post by: JTaylor on May 29, 2024, 07:25:29 AM
Sorry.  Guessed I missed those discussions or forgot about them.   It isn't an editor/display issue that is the concern.  I found it during the discussion with Stan on RegEx as it broke the script since it was introducing characters into the data that wasn't there.

Oh well, sounds like it will not be corrected so will just keep in mind, hopefully.

Jim
Title: Re: $" - Line Continuation Bug?
Post by: td on May 29, 2024, 09:26:39 AM
Obviously, it is not a display issue of any kind.

An article explaining multiline line terminators can be found here:
String Constants (https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/HTMLWIL_SC_001.htm)