Thanks Kerm! I'm still learning regex, so I don't know how to use groups yet.
Deep Thought wrote:
Thanks Kerm! I'm still learning regex, so I don't know how to use groups yet.
Not a problem. Would you like me to explain how this regex string works?
I can probably figure it out, but maybe for other people?

And I just noticed it excludes stuff like F00h Very Happy
Deep Thought wrote:
I can probably figure it out, but maybe for other people?

And I just noticed it excludes stuff like F00h Very Happy
Correct, which is what it should do. Smile F00h is a string literal, like a label, not a number. Smile

Breaking it down:
(\$[0-9A-Fa-f]+)|([1-9][0-9A-Fa-f]*h) Two options, OR'd together
(\$[0-9A-Fa-f]+) First a $, then one or more character in 0-9, a-f, or A-F
([1-9][0-9A-Fa-f]*h) First one character 0-9, then zero or more characters in 0-9, a-f, or A-F, and finally an h.
And to capture a decimal number it's just [1-9]*, right?
Deep Thought wrote:
And to capture a decimal number it's just [1-9]*, right?
Nope, [1-9][0-9]*. Your string would capture zero or more numbers 1-9, such as [null string], 11, 19, or 94423434. It would not get 10 or 10000000034340.
Oh, whoops, still learning that stuff XD
Deep Thought wrote:
Oh, whoops, still learning that stuff XD
No problem. You post how to match octal things like 023 or 23o, and I'll tell you if it's right. Smile
gedit version works (for both Windows and Linux)!
And now it's in the archives, along with an updated Notepad++ and Programmers' Notepad version! Did you see my octal puzzle?
Octal puzzle?

EDIT: I'm using (0[0-9A-Fa-f]+)|([1-9][0-9A-Fa-f]*o) for octal matches.

EDIT2: Dang, I meant (0[0-7]+)|([1-7][0-7]*o). Copy/paste fail. I'll fix that later.
Looks good to me! Nice job. Smile
Here to show my support for Notepad++. I was interested in z80 syntax highlighting some years ago and I remember finding the scheme file on this guy's blog.
Progbeard wrote:
Here to show my support for Notepad++. I was interested in z80 syntax highlighting some years ago and I remember finding the scheme file on this guy's blog.


There's already a Z80 scheme? Darn.
Deep Thought wrote:
Progbeard wrote:
Here to show my support for Notepad++. I was interested in z80 syntax highlighting some years ago and I remember finding the scheme file on this guy's blog.


There's already a Z80 scheme? Darn.


IIRC, but it's convenient to have it right here for everyone. And I distinctly recall it not highlighting some of the lesser-used mnemonics.
Just wanted to pop in and mention that Deep Thought uploaded new updates to the versions in the archives; not sure what they add, though. I'm sure Deep Thought would be able to eludicate us.
Forgot to mention: fixed octal matching and swapped in a new screenshot.
Nice work Smile Though I'll still use WabbitCode because of projects. I guess that every version you have made have the same coloring schemes?
Similar. gtksourceview-2.0 is different because it changes based on which theme the user is using.
Bump.

This time around I actually know XML and regex, so thought I'd do a whole rewrite:



Download
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement