Description
Parse positive surah:ayah or surah:first-last syntax without leading zeros.
Source-scoped cultural and historical records preserve an edition, naming convention, or local identifier. Literal agreement is useful bookkeeping but does not establish interpretation, authenticity, or authority.
Parse positive surah:ayah or surah:first-last syntax without leading zeros.
When to use this tool
Use Quran Surah Ayah Range Parser when you need a precise source-token or range consistency check.
How to use the tool and how it works
- Enter reference, maximumAyah. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read surah, firstAyah, lastAyah, count. Use the output convention below.
Parse positive surah:ayah or surah:first-last syntax without leading zeros. Bound surah by 114 and ayah endpoints by supplied maximumAyah; return the inclusive count.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| reference | Reference | Required. Text; maximum UTF-16 length 8192. |
| maximumAyah | Maximum Ayah | Required. Safe integer; minimum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| surah | Surah | Required. Safe integer. |
| firstAyah | First Ayah | Required. Safe integer. |
| lastAyah | Last Ayah | Required. Safe integer. |
| count | Count | Required. Safe integer. |
{
"input": {
"reference": "2:255-257",
"maximumAyah": 286
},
"output": {
"surah": 2,
"firstAyah": 255,
"lastAyah": 257,
"count": 3
}
} Limitations and assumptions
- The caller must provide the correct maximum for the intended surah and edition; no text or verse table is consulted.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Consult the source edition and relevant community or scholarly guidance before interpreting or reusing the material.
References
Similar or alternative tools
- Public Ayah Range Overlap
Count the inclusive overlap as max(0, min(ends) - max(starts) + 1) across two ordered positive ayah ranges.
- Public Manuscript Ayah Range
Subtract firstAyah from lastAyah and add one when includeEnd is true.