appyface Posted March 27, 2017 Report Share Posted March 27, 2017 Using Ketarin 1.8.7. I hope someone can help to explain what I'm seeing. First, please look at this example: 1. Create ketarin variable "vers", load this URL: http://www.piriform.com/ccleaner/download 2. Regex: release notes.*?<strong>.*?v(.{1,10})\n This (today) populates "vers" with 5.28.6005 Note the linefeed match. Now, copy/paste the page source directly from the Ketarin window into a hex editor or other editor that can visualize carriage returns and linefeeds. When I paste this source into EditPad Pro (my usual editor) and display it hex mode, what follows the 5.28.6005 in the source is a x0D x0A - carriage return/linefeed. I am assuming Ketarin is correct and the source really is LF/CR. Or is Ketarin mis-interpreting the source? I've not had any problem in the past with EditPad Pro showing terminators incorrectly, it supports all the variations, but I'll try another hex editor anyway. Assuming for the moment that EditPad Pro isn't at fault here either, could windows be converting the terminators in the clipboard to standard windows CR/LF sequence? I'm using Win 10 Pro. Thoughts? Link to comment Share on other sites More sharing options...
shawn Posted March 27, 2017 Report Share Posted March 27, 2017 Windows sometimes converts LF+CR to CR+LF when copied to the clipboard. That said, I tested the URL in several different clients and got CRLF in all of them. That said, regexp "\n" can match not only CR but all combinations of CRLF, LFCR, LF and CR. It can also match instances of x09 (tab) and x0B (vertical tab) and \u0085 (unicode new line). It doesn't merely mean "new line", but "characters commonly interpreted as a new line", based on the specific RegExp client. Link to comment Share on other sites More sharing options...
appyface Posted March 27, 2017 Author Report Share Posted March 27, 2017 Thanks Shawn for confirming what I suspected with windows clipboard. Which Regex engine is Ketarin using? .Net or ? Link to comment Share on other sites More sharing options...
MAPJe71 Posted March 27, 2017 Report Share Posted March 27, 2017 AFAIK it's a .NET application coded in C# not using any 3rd party libraries for regular expressions. Link to comment Share on other sites More sharing options...
appyface Posted March 28, 2017 Author Report Share Posted March 28, 2017 I think that's right, too. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now