Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@homaily
homaily / gist:8672499
Last active April 15, 2024 05:57
Regex to validate saudi mobile numbers

السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .

Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .

/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/

Regex Breakdown - شرح الكود

#!/bin/bash
DIR=`pwd`
DB_HOSTNAME_DEFAULT=localhost
DB_USERNAME_DEFAULT=root
read -p "Enter HTTP_SERVER: " HTTP_SERVER
read -p "Enter DB_HOSTNAME ($DB_HOSTNAME_DEFAULT): " DB_HOSTNAME
@homaily
homaily / cities.json
Created February 17, 2015 19:00
Saudi Arabia Regions, Cities and Districts
[
{
"city_id" : 1,
"region_id" : 3,
"name" : {
"ar" : "تبوك",
"en" : "Tabuk"
}
},
{
@homaily
homaily / index.html
Created April 8, 2015 13:44
Whatsapp share button
<a alt="Whatsapp" href="whatsapp://send" data-text="Text to share" data-href="http://example.com/url-to-share" class="whatsapp wa_btn"><span class="ion-social-whatsapp"></span> Whatsapp</a>
@homaily
homaily / create.php
Created February 22, 2016 10:59
#Pay api client demo in PHP
<?php
include_once 'functions.php';
$data = array(
"title" => "New Invoice",
"price" => 10,
"currency" => "SAR",
"description" => "Create new invoice.",
@homaily
homaily / index.js
Last active December 16, 2022 13:13
Lambda download and cache gzipped file from s3
'use strict';
console.log('// loading function');
const aws = require('aws-sdk');
const s3 = new aws.S3({apiVersion: '2006-03-01'});
const gzip = require('zlib').createGunzip();
const fs = require('fs');
@homaily
homaily / keybase.md
Created April 28, 2020 00:00
Keybase

Keybase proof

I hereby claim:

  • I am homaily on github.
  • I am homaily (https://keybase.io/homaily) on keybase.
  • I have a public key ASCQpZIM9BD-p61rgG4jjXwJb1-lV24w3os2F4N9ih6VWAo

To claim this, I am signing this object: