Typo commented on a Page, Typos Code Comparison  -  Jul 28, 2008

If bytes are not counted like that then why is it that my following example is valid? And BTW, who the hell was talking about spaces at all? Trailing or leading spaces have nothing to do with anything Ive talked about yet. Its the carriage returns.
Do you even know how to read a response to your own comment?

For instance, weve all been taught that a single character is one byte so the following:

A
B

would look like it should be 2 bytes but we would be forgetting the 2 bytes for the carriage return needed to start the second line.
If you start a new file and save it with the above lines you will see when looking at the file properties that it is 4 bytes and not 2.
Did you even try that?
You can say all day long that file sizes dont work that way but your wrong. Its simple, start a new file, make two lines of one character each and save it, check the file size in windows and by using $file().size as well. It will never equal 2 bytes even tho its two characters.

The script just compares 2 codes anyway, I could theoretically account for the carriage returns and take it out of the file size so it compares actual used characters but then nothing would match actual file sizes and I see no point in that.

Now on to the regex. You know I am learning regex and in the comment I made to you in this thread I mentioned that I realized you were right about the regex and came up with a fix and told you what it was that I was trying to do.

The following lines are from the tutorial @ http://www.hawkee.com/phpBB2/viewtopic.php?t=9764 .
[quote]
To negate a character group (meaning \"anything but\"), use a ^ character.
Also remember that you still have to escape special characters inside a character group. People tend to forget that for some reason.
$regex(abcdefg,/[^a-e]/g) -- Returns 2 because 2 letters (f and g) satisfied the character group of \"anything but a-e\"

Im sure you get what I was trying to do now but Im guessing by your comment that my method is wrong so Ill look into changing it with another method or a better regex right now. Off the top of my head I think just using /(^(?!$))/ should be fine but I need to make positive first .[/quote]
I thought I had upgraded the code to the regex I mentioned in the above quote which was addressed to you but apparently I didnt so I will do so now. The new regex is /(^(?!$))/ and it seems to work great for me. I even did a test using /filter with -x to make it send the non matching lines and it did kick back the blanks.

Had you actually read what I typed in response to you instead of making the rude comment above you could have just mentioned that I needed to do the update I forgot to do so and if the new regex is actually wrong than you definately could have caught that too and since I went into detail to you what I was trying you actually could have helped me without inviting me to your network again.

I mean not offense at all, but your code (coding style?) feels quite messy, if you want, I can teach you some \'better\' coding (im not trying to brag, really) and how to properly master regex. If you\'re up for it, I\'ll be at: irc.deltaanime.net @ #Lindrian
Who the hell would not take offense to that?
I want to know what about my coding style is messy, sure Im learning regex and your better than me at it but what about my coding exactly is it that you find messy?
Sure I use the if $1 == $null instead of if $1 and a couple other things like that that I consider bad habbits but compared to most my code is damn clean and easy to follow.

I decline the invitation to your network but I do reccomend in the future that you keep your posts less opinion and more factual.
Why tell someone somethings wrong and not why or how to fix it. Why say a file size is wrong when you dont even look at the code to see that its $file().size thats getting the size so it has to be right. Why for the second time dong on my regex without reading my response to you and helping me actually fix it. And btw, helping here is much more appropriate than making people come to your network.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.