Sunday, March 8, 2015

Email Validation with Regular Expression (PCRE)

The following is an regular expression for matching a valid email address.

It has been tested with PHP's PCRE, but it can work with other regex environments.

It will match valid email addresses in multiple lines (one email address per line)

Email Validation Regex


/^([\w\-_~!$&'()*+,;=:]|(?<!^)(?<!\.)\.(?!\.)(?!@))+@(\w|(?<!@)(?<!\.)(?<!\-)\.(?!\.)(?!\-)(?!$)|(?<!@)\-(?!$))+$/img

Regex analysis


It validates based on the following rules:

  • start of line
  • user part (local part)
    • one or more of the following:
      • alphanumeric character
      • specific punctuation: -_~!$&'()*+,;=:
      • a dot (.)
        • if it is not preceded by
          • start of line
          • another dot (.)
        • and not followed by
          • another dot (.)
          • @ symbol
  • @
  • domain part (hostname part)
    • one or more of the following:
      • alphanumeric character
      • a dot (.)
        • if it is not preceded by
          • @ symbol
          • another dot (.)
          • a hyphen (-)
        • and if it is not followed by
          • another dot (.)
          • a hyphen (-)
          • end of line
      • a hyphen (-)
        • if it is not preceded by
          • @
        • and if it is not followed by
          • end of line
  • end of line

Email Syntax Rules

The email syntax rules that are implemented are the following:

Local part
  • Uppercase and lowercase Latin letters (a–z, A–Z) (ASCII: 65–90, 97–122)
  • Digits 0 to 9 (ASCII: 48–57)
  • These special characters: - _ ~ ! $ & ' ( ) * + , ; = : and percentile encoding i.e. %20
  • Character . (dot, period, full stop) (ASCII: 46) provided that it is not the first or last character, and provided also that it does not appear consecutively (e.g. John..Doe@example.com is not allowed).
Hostname part

  •  Alphanumeric characters
  • dots (.) but not two or more consequtives dots, not at start of hostname or end of hostname part
  • hyphens, but not at start or end of a label (name between dots)
There are more advanced rules that are not covered by this regex.

Thursday, March 5, 2015

Introducing Regular Expressions

A must read for programmers of any language. Sooner or later you'll bump onto regular expressions


http://it-ebooks.info/book/871/

Saturday, January 31, 2015

www.w3schools.com

 Great Beginner's Site for Web technologies

PHP Tutorial
http://www.w3schools.com/php/default.asp


Web services Tutorial:
http://www.w3schools.com/webservices/default.asp


Sunday, June 1, 2014

Cruise for a Corpse - vintage adventure game




I found this awesome adventure game vintage adventure game and playing it at DosBox (MS-DOS emulator). Although I know who the murderer is, it's fun and relaxing to play again one of my youth favorites adventure game.

You take the role of a private investigator. You are invited aboard a cruise by a wealthy friend of yours 'Nicklos Karaboujan' aboard. But the night the cruise begins the Nicklos is murdered. You have 24 hours to find the murderer before the ship reaches it's next destination.

It was hours of mystery and fun! I strongly urge you to play it.

Wiki: Cruise for a Corpse



Saturday, May 31, 2014

HOARD HAT - Random Treasure Generator DnD v3.5 - FREE Mobile App - No internet connection required

Play/Install (mobile & desktop): http://hoardhat.killerchip.net/
More Killerchip Apps: http://www.killerchip.net/

Random Treasure Generator for RPG games (v3.5)

Hoard Hat is a random treasure generator for RPG games (v3.5). A companion for those that build adventures before-hand or need to quickly roll treasure for an 'unexpected' encounter.

T-Roll - Dice Roller - FREE Mobile app - No internet required

Play/Install: http://troll.killerchip.net/ (for desktops also)
Home Page/More info: http://www.killerchip.net/troll.html
More Killerchip apps: http://www.killerchip.net/





T-Roll is a dice roller for RPG games and tabletop games in general. It allows MASSIVE rolls of dice and instantly sum and count results.

Features:
* Dice supported: d4, d6, d8, d10, d12, d20, d100
* Massive Rolls (e.g. 400d20 is easy)
* Automatic Summary of rolls (e.g. sum-up of 20d6)
* Automatic count analysis of rolls (e.g. how many 1s, 2s, 3s, 4s rolled on 50d4)
* Easy counts of rolls (e.g. how many 19s+20s on 50d20 rolls)
* Mixed rolls (e.g. 30d4+20d20+10d6)

And of course easy simple rolls.
* Single click d6 to roll a d6 once.
* Click 4 times d20 to roll 4 d20 in row