Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

A regular expression tutorial

  • Please log in to reply
23 replies to this topic
  • Members
  • 68 posts
  • Last active: Jan 04 2011 01:12 PM
  • Joined: 26 Jul 2006
No you aren't, serif fonts are cool. 8)
Just take one of the new default windows vista fonts "Cambria", it's cool as hell and definately a better job than every other MS font made to date.
Actually I'm much more of a designer than a Coder, and seeing Arial, Times New Roman or Comic Sans MS gives me the creeps. *shudders*

  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Adobe's variant of Garamond is far better than Cambria IMO. That's off topic anyway...

autohotkey.com/net Site Manager


Contact me by email (polyethene at autohotkey.net) or message tidbit

  • Guests
  • Last active:
  • Joined: --

serif fonts are cool

for printouts (hardcopies) - yes. On screen NO, never ever ! From an ergonomics perspective a NO go!

  • Members
  • 68 posts
  • Last active: Jan 04 2011 01:12 PM
  • Joined: 26 Jul 2006
We're geetin' quite offtopic here but you're right too.
Whoever at MS thought that it would be good idea, to have Times New Roman as default font for every damn office document should read a 1000+ pages book entirely set in serifs on a CRT. That said, serifs are still cool :p

  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

serif fonts are cool

for printouts (hardcopies) - yes. On screen NO, never ever ! From an ergonomics perspective a NO go!

Exactly, that's why I put serif fonts in the PRINT stylesheet (and in the big titles of display media, where they are OK), not in the DISPLAY one (except in the titles!)...

Times New Roman is just a fallback font, I put it because I am sure it is on all Windows installs. But I specified Georgia as print font, it is nice and readable.

@JSLover I won't put a Print button (using JS?) but I might provide alternate stylesheets. But well, it is much easier for you (and for me) to just provide a user stylesheet, don't you think? They are here for that.
Well, is IE able to use user stylesheet? I hope they did it.
And of course, you can also hate the font size I used, and so on, so I can't please everyone, like any other Web site.

Thanks for spotting the typos. I found also (actually, Thunderbird' spellchecker) an errror, a licence, consecutives chars, occurence (many of them!), avidely, expresssions, unmaintenable, simplier, signifiant... Lot of these errors coming from French, except the triple letters, of course.
(license, consecutive, occurrence, avidly, unmaintainable, simpler, significant... I have to remember...)

Notes on your corrections: indeed, "question mark" is used in the pcrepattern specification, so I used it instead of "interrogation point". "Point d'interrogation" is the official French name, and for us, it is a point, like the "point d'exclamation", "deux points", "point virgule", "points de suspension" and so on. Oh, it is not interrogative here, indeed, but there is no question either...
In the above doc., they use "circumflex", so I keep it. I saw it in (technical) documents more often than your carat. I dropped the "accent", though.
Offline vs. off line. I believe both are correct, the first one being more technical, perhaps? But rejected by some spellcheckers...
A vs. an, an old problem, hard for us Frenchies... (no hard rule, based on pronunciation).

About the "acronym resolver" (ie. the use of abbr and acronym HTML tags), I disagree with you. I find annoying, redundant and space wasting to repeat systematically these tags on each and every occurrence of an abbreviation. If I have to put them on each RE I wrote, it would seriously bloat the article! Common practice is to put only one expansion per page, or perhaps one per section. Of course, it can also depends if the page is made to be read from start to end (eg. a tutorial...) or to pick up things as needed (a reference). A delicate balance, as always.
I should finish the work and add the tags (without title) on all occurrences, but I will be a bit lazy here... (added the aural CSS, not the tagging).

@Titan I don't agree with you with the absolute width stuff. I have a 1280 pixel width screen, and I like my layout the way it is... Very long lines of text are hard to read, that's why newspapers put text in lot of very narrow columns... I didn't went this far, but I want to keep my lines at a reasonable size. Of course, I removed this limitation in the print version: you can get your wide lines, or print in several columns if your driver allows it.
About the background: I feared somebody complained about it. I avoided a white background because lot of people complain that's too hard on the eyes. I tried to do something close of gray, but a bit fancier, while being low contrast to avoid distracting the eye. The contrast between text and background is correct for me, but I suppose it depends on the monitor and the eye of the viewer. It is a delicate matter. Perhaps I should use a complementary color.
[EDIT] I created a different background, based on #DD7 color (opposite of #228 (?)). It looks a bit better. Headers stand out more, I am not sure if that's OK or if I should correct them. I changed the color of links.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
I wanted to see if my regular expression tutorial page was listed in the first 50 entries in Google, when searching "regular expression" tutorial. (vanity, vanity... :-))
And what I find? A link to this very topic!

A regular expression tutorial - [ Traduire cette page ]
OK, after some days of "rest" (doing something else), I finally acheived my regular expression tutorial! You can find it on my site. ...
www.autohotkey.com/forum/topic11313.html - 61k - En cache - Pages similaires

Well, that's better than nothing... :-D
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

  • Members
  • 920 posts
  • Last active: Nov 02 2012 09:54 PM
  • Joined: 20 Dec 2004
See...even Google loves AHK!...or at least indexes the forums well...hits for JSLover used to pull up my older posts on the internet (& some annoying real people whose is JSlover {lowercase l}...can you figure out which ones are me?...Google also has an annoying habit of asking "Did you mean: test Jsolver"...no! I meant J-S-Lover {but without dashes})...now it pulls up the old posts...but more specific searches with my internet handle & some other words pull up my new posts here!

Offline vs. off line.

...offline was only part of the correction...the whole line was red cuz there were more things different...
[*:3683b6tm]s/install a software to test off line/install software to test offline/g..."install a software" (like the others you corrected) just don't sound right...it would be "install a program" or just "install software"...

I believe both are correct, the first one being more technical, perhaps? But rejected by some spellcheckers...

...yes, non-English (US, not "English") spell checkers will even say "color" is wrong & is right. The rule of thumb I use (when I don't know which way I like it {in this case I like offline}) is...ask Google...I would search Google for "offline" & "off line" & whichever has the most results, I use...cuz it is the more common use...HEY LOOK...

":3683b6tm]Did you mean: "offline"

...Google got it right!...but Wikipedia got it wrong!...booo! A possible mid-way clarification (compromise, your-way & my-way)...
[*:3683b6tm]s/circumflex ^ character/circumflex (carat {Shift+6}) ^ character/g...newbie regexers might not understand either circumflex or carat, but if they don't know Shift+6 they don't need to make regexes! Another point...you might want to standardize your use of RegExp, RegEx & RE...you explain at the top that any are acceptable, but you don't stick to one for your idea of correct...I like regex, regexes...I don't like RE, REs...RegExp is only the name of the JavaScript function, not what I normally call it...

I created a different background, based on #DD7 color (opposite of #228 (?)). It looks a bit better.

...I think it looked better before...maybe the text was hard to read, but the new diarrhea bg looks awful (I don't like that color...{I also don't like green/teal/ as a color either, but it looked nicer than the new color...try a black bg with 8a2be2 or 8080ff text!})...perhaps the old background, with some other color text or something...but it seems worse now...(re-reading the above it might seem like I'm telling you what to put on your page, but please only take this as advice, you can make your page how you want...of course!)...
Useful forum links: New content since: Last visitPast weekPast 2 weeks (links will show YOUR posts, not mine)

OMFG, the AutoHotkey forum is IP.board now (yuck!)...I may not be able to continue coming here (& I love AutoHotkey)...I liked phpBB, but not this...ugh...

I may not reply to any topics (specifically ones I was previously involved in), mostly cuz I can't find the ones I replied to, to continue helping, but also just cuz I can't stand the new forum...phpBB was soo perfect. This is 100% the opposite of "perfect".

I also semi-plan to start my own, phpBB-based AutoHotkey forum (or take over the old one, if he'll let me)
PM me if you're interested in a new phpBB-based forum (I need to know if anyone would use it)
How (or why) did they create the Neil Armstrong memorial site (neilarmstronginfo.com) BEFORE he died?

  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

& some annoying real people whose is JSlover {lowercase l}...

Thats why I took this nicname. I can use Google to see all my posts, and I am sure there is no other majkinetor around :)
Posted Image

  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
JSLover, I really appreciate your input, even if I don't buy everything... :-)
I corrected an "install a software" but missed another... Corrected.
I saw I used "online" above, so for consistency I used "offline"... Happy? ;-)
Dropping consistency, I keep my different ways of abbreviating "regular expressions", it is a way to avoid repetition...
I added "carat", it doesn't hurt. But I avoided the Shift+6, because on my keyboard it has a dedicated key (it is important to write French), and on other locales, it is probably something else.
The background color: I would call is "mustard" instead... :-)
I am not a big fan either, but it is OK. What others think of it?
I will avoid black, I am not an adept of this color setting, even if I worked a lot with old terminals (you know, black screen, white, green or yellow text...).
Perhaps I should make it even lighter, perhaps a bit more greenish.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")