It is currently Sat Apr 29, 2017 4:22 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Looking for a regular expression
Unread postPosted: Fri Feb 17, 2017 2:42 pm 
Offline

Joined: Sat Feb 11, 2017 1:40 am
Posts: 68
Location: France
To match any kind of linebreak characters, in a Split, Words$ or Trim$ command, I tried both
"(\r\n)|(\r)|(\n)"
and
"\\R".
None does what I expect, certainly due to error in the regex syntax.
I promise to seriously learn regex; supposed I find what implementation is used in Basic!.
Meanwhile, please somebody give me the exact coding to match all occurrences of the unknown linebreak used in some file. Considering also that a file may use more than one kind among [0D, 0A, 0D0A], not rare a case

Bad answer: "\\s+", wich also matches spaces and tabs.

_________________
Alain


Last edited by Sprougnaf on Sun Mar 05, 2017 11:44 am, edited 1 time in total.

Report this post
Top
 Profile  
 
 Post subject: Re: Looking for a regular expression
Unread postPosted: Wed Mar 01, 2017 9:42 am 
Offline

Joined: Sat Feb 11, 2017 1:40 am
Posts: 68
Location: France
SOLVED.
As often, the most basic was the best.
Code:
Regex: \x0A|\x0D|\x0D\x0A
Basic string:
"\\x0A|\\x0D|\\x0D\\x0A"

_________________
Alain


Report this post
Top
 Profile  
 
 Post subject: Re: Looking for a regular expression
Unread postPosted: Wed Mar 01, 2017 10:10 am 
Offline

Joined: Tue Dec 04, 2012 10:50 am
Posts: 644
Location: UK
Back when teleprinters had mechanical carriages, the carriage return took approximately a character duration to take effect. So long as the next character was new-line (0D0A) it did not matter if the carriage had not got fully returned. If new-line had come first then carriage-return (0A0D), the first character on the new line might get printed while the carriage was still returning!

Mike.


Report this post
Top
 Profile  
 
 Post subject: Re: Looking for a regular expression
Unread postPosted: Thu Mar 02, 2017 2:59 am 
Offline
User avatar

Joined: Thu Jan 08, 2015 11:28 am
Posts: 1088
Location: .NET
mjcoon wrote:
Back when teleprinters had mechanical carriages, the carriage return took approximately a character duration to take effect. So long as the next character was new-line (0D0A) it did not matter if the carriage had not got fully returned. If new-line had come first then carriage-return (0A0D), the first character on the new line might get printed while the carriage was still returning!

Random Trivia Mike.

_________________
https://github.com/evolbug
http://toobasic.jimdo.com


Report this post
Top
 Profile  
 
 Post subject: Re: Looking for a regular expression
Unread postPosted: Thu Mar 02, 2017 3:23 am 
Offline

Joined: Tue Dec 04, 2012 10:50 am
Posts: 644
Location: UK
evolbug wrote:
mjcoon wrote:
Back when teleprinters had mechanical carriages, the carriage return took approximately a character duration to take effect. So long as the next character was new-line (0D0A) it did not matter if the carriage had not got fully returned. If new-line had come first then carriage-return (0A0D), the first character on the new line might get printed while the carriage was still returning!

Random Trivia Mike.

"Random"? How very dare you! That was an impertinent reaction to my pertinent trivia...

Mike.


Report this post
Top
 Profile  
 
 Post subject: Re: Looking for a regular expression
Unread postPosted: Fri Mar 03, 2017 10:03 pm 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2795
Location: Colorado, U.S.
We've got guys who were there when the things kids take for granted were being invented. It follows naturally enough from the guy who founded the forum, but it's still part of what makes being here so interesting.

- Marc


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred