Regular Expressions (abbreviation:
RegEx) are signs which built in an intelligent and easy to understand system. We have the ability to use this system in
AlQuran.eu and improve our work much faster and even exactly. If users of OpenQuran doing research to the counts and calculations of Letters/words/verses and there gematrical values than its very important to understand the idea behind
RegEx. RegEx is mostly used in programming languages, databases, search engines, Spam filters etc. It's easy to understand but needs from us more the artistic talent on how to build the RegEx definitions. There are also a lot of Sites which have more detailed informations on how to use this small powerful language, but the would like easily show how to use with the Arabic language and specially for the Quran.
\w
This will count any letter found in the whole quran.
(run Analyze "right click" instead of normal search. Cause OQ colorizes every sign to red)
326030 Entries (328158 with Basmalah/s* ), 6234 Verses in 114* Suras
^\w{7}\b
views verses which begin with a
7 letters word like (
واقيموا الصلوه ) in verse 2:43
//
304* Entries, 304* Verses in 77 Suras
\b\w{6}\b
views any
word which consists of
6 letters
11163 Entries (11387 with Basmalah/s ), 4669 Verses in 112 Suras
^[\w| ]{19}ا
searches for
Alif letter after counting 19 leters or spaces
710 Entries, 710 Verses in 95* Surahs
^(\w[ ]*){114}ا
searches for
Alif letter after counting 114 letters (
WITHOUT counting spaces)
//
57* Entries, 57* Verses in 23 Suras
^الرحمن
find verses which begin with
الرحمن
3 Entries, 3 Verses in 3 Suras. Count Sura Numbers: 76*
الرحيم$
find verses which end with
الرحيم
33 Entries, 33 Verses in 19* Suras, count dura numbers 551*, Letters count of all found verses 1444*
ل{2}
find all double
لل
3253 Entries (3365 with Basmalah/s ), 2147* Verses in 96 Suras
[ب|س|م|ا|ل|ه|ر|ح|ن|ي]
find the letter
B or
S or
M etc
(letters of Basmalah)
221654* Entries (19*19*614) (223782* with Basmalah/s* ), 6234 Verses in 114* Suras, Count Sura Numbers: 6555*
[^ب|ج|د|و|ز|ف|ش|ت|ث|خ|ذ|ض|ظ|غ]
find any letter accept
B or
G or
D etc..
(None initial letters)
315155 Entries (317507 with Basmalah/s ), 6234 Verses in 114* Suras
Searching for some unique words like Allh =
الله
it´s important to have some knowledge about the different forms of this words. Some times its written LLH =
لله or FALLH =
فالله or BALLH =
بالله or WLLH =
ولله but not
DLLH = ضلله .
The best definition we found to get all words is as follow:
( |ا|و|ف|^)لله( |$)
2698* Entries (2810 with Basmalah/s ), 1820 Verses in 85 Suras
\bالقرءان\b
finds the word
ALQRAAN exactly the way its written
43 Entries, 43 Verses in 28 Suras, Count Sura Numbers: 893*
\bكتب|كتاب\b
finds the word
KTB or
KTAB exactly the way they are written
102 Entries, 95* Verses in 45 Suras
(\b(ال|و|ف|ء|ب)*ا[ء]*له(ا|ك|كم|نا|ه|ين|ت|تهم|تي)*\b)|( |ا|و|ف|^)لله( |$)|اللهم
This one is a difficult example showing the roots of ALH
اله in all different shapes used in the Quran
2849 Entries, 1878 Verses in 86 Suras
[^ع]ابدا
Here we need the word ABDA
ابدا but without the letter
ع before
28 Entries, 28 Verses in 15 Suras
ن[ ]*و[ ]*ن
This will find
يمنون in one word or in 2 words beside each other
بالسنين ونقص
247* Entries, 235 Verses in 65 Suras
To look for every verse which begins with a specific letter and ends with another specific letter we do as follow:
We search for verses that begin with Ba
ب and ends with Mim
م like the Basmalah (first verse in surah 1):
^ب.+م$
AlQuran finds 3 verses in such manner which consists of 114 (19*6) letters.
If we also search for verses that begin with Saad
ص and end with Nun
ن (last verse of surah 1)
we´ll find also 3 verses that have a gematrical value of 9728 (19*512):
^ص.+ن$
We can also include both mehtods in one definition!
For example we search for verses which begin with letter Be
ب or Saad
ص and end with Mim
م or Nun
ن :
^[ب|ص].+[م|ن]$
In such manner we find 46 verses which have the gematrical value of 130473 (19*6867)
If we want to look for all words which begin with a specific letter (e.g. the letter
س )
\bس+
Some times letters have 2 or more different shapes like
Alif and
Hamza.
The following example will find all words begining with Alif or Hamza:
\b[ا|ء]+
At the begining of the verse, there must be (a word with 3 letters) than (Space) than (ALLH). same as
بسم الله
^\w{3} الله
Now we need verses that must have letter
ص and
كت and
ال same as in this verse:
وا
كتب لنا فى هذه
الدنيا حسنة وفى
الءاخرة إنا هدنا
إليك ق
ال عذابى أ
صيب به من أشاء ورحمتى وسعت كل شىء فسأ
كتبها للذين يتقون ويؤتون
الزكوة و
الذين هم بءايتنا يؤمنون
^(?=.*ال)(?=.*كت)(?=.*ص).*
If you wanna get the reversed results of the example before, which means we get verses that DO NOT have letter
ص and
كت and
ال same as in this verse:
إياك نعبد وإياك نستعين
You need to change the equal mark (=) to exclamation mark (!)
^(?!.*ال)(?!.*كت)(?!.*ص).*
If you have any question regarding RegEx in Alquran than we are glad to help.