Code:
on $*:text:/!quran \[(\d+)\x3A(\d+)(-(\d+))?\]/:#:{
  var %line.length = 300
  var %line.range.size = 100
  var %chapt = $regml(1)
  var %line_from = $regml(2)
  var %line_to   = $iif($regml(4),$v1,%line_from)
  if ($calc(%line_to - %line_from) > %line.range.size) || ($v1 < 1)) {
    echo -st msg # Try keeping the range within real limits!
  }
  else {
  ;
  ;*** Lets get it done! ***
  ;
  var %filesize = $file(quran.txt).size
  .fclose quran.txt*
  .fopen quran.txt quran.txt
  echo -st msg # S eTahoma;7 Bismillahi Arahmani Araheem 
  var %line_at = %line_from
  while (%line_at <= %line_to) {
    var %find = $+([,%chapt,:,%line_at,])
    .fseek quran.txt 0
    .fseek -w quran.txt $+(%find,*)
    if ($fopen(quran.txt).pos == %filesize) {
      if (%line_from == %line_to) {
        ;say it dont exist only if its was only one line requested
        msg # %find No Ayah exists.
      }
    }
    else {
      !.echo -q $fread(quran.txt,10240,&binvar)
      breplace &binvar 13 0
      breplace &binvar 10 0
      var %line.end = $calc($iif($bfind(&binvar,1,0),$v1,10241) - 1)
      var %line.start = $calc($len(%find) + 1)
      while (%line.start <= %line.end) {
        msg # %find $bvar(&binvar,%line.start,%line.length).text
        inc %line.start %line.length
      }
    }
    inc %line_at
  }
  .fclose quran.txt*
}


Here's your regex stuff :tongue:

I'm not quite happy with the whole binary var stuff, my suggestion would be to open the file wsith some text editor and making it wrap at about 200 characters. Then search for the correct [1:2] stuff and continue reading lines until you reach a line that starts with [1:3] or just starts with a [ even.

Another way, put the [1:2] tags on their own lines, with all relevant text on following lines (how many doesn't matter, just make sure they're not long that 200 characters or so. Then do //play -t $+ 1:2 quran.txt $chan to send the text to channel, with 1second intervals so you won't flood off.