 q, b, c, d, a, p[5, 6], q, b, {}, p[7, 8], e, a, p[2], q, e]};
         First@Cases[list, p[args : PatternSequence[___, a, _p, q, ___]]:>SequenceCases[{args}, {a, p[x_, y_], q} :> {x, y}], Infinity]
         Cases[Partition[List @@ list[[1]], 3, 1], {a, p[x_, y_], q} -> {x, y}]

Out[615]= {{1, 2}, {3, 4}, {5, 6}}
Out[616]= {{1, 2}, {3, 4}, {5, 6}}

A:

I don't know how extensible this is, but it works for your case,
Cases[list,
    p[args:PatternSequence[___, a, _p, q, ___]] :> SequenceCases[
        {args},
        {a, p[x_, y_], q} :> {x, y}
    ],
    Infinity
]
(* {{{1, 2}, {3, 4}, {5, 6}}} *)

 Q:

PHP Wait for PDF to be created and then send it in a mail?

I've written this script that sends customer a receipt of their order, but it has a problem: 
It won't wait for the PDF script.
So it simply requires the PDF script, and starts executing it and sends the mail while the PDF script is still working on the PDF. I'm sure that there is a way to delay the email script, but to make thing more complicate: 
The whole order.php is executed with jquery ajax call, and the script will wait for the php to finish and then reports browser that request was succeeded. So it could wait over five minutes while the client would be wondering why it's taking so long.
So I need it to wait for the PDF to be created and then send the mail, but it shouldn't leave the client waiting. 
Here's my code:
<?php 
    $addid = "orderid.txt";
    $current = file_get_contents($addid) + 1;
    echo $current;
q, b, c, d, a, p[5, 6 ], q, b, { }, p[7, 8 ], e, a, p[2 ], q, e ] }; 
          First@Cases[list, p[args: PatternSequence [ _ _ _, a, _ p, q, _ _ _ ] ] :> SequenceCases[{args }, { a, p[x _, y _ ], q } :> { x, y } ], Infinity ] 
          Cases[Partition[List @@ list[[1 ] ], 3, 1 ], { a, p[x _, y _ ], q } - > { x, y } ] 

 Out[615]= { { 1, 2 }, { 3, 4 }, { 5, 6 } } 
 Out[616]= { { 1, 2 }, { 3, 4 }, { 5, 6 } } 

 A: 

 I don't know how extensile this is, but it bring for your case, 
 Cases[list, 
     p[args: PatternSequence [ _ _ _, a, _ p, q, _ _ _ ] ] :> SequenceCases [ 
         { args }, 
         { a, p[x _, y _ ], q } :> { x, y } 
     ], 
     Infinity 
 ] 
 (* { { { 1, 2 }, { 3, 4 }, { 5, 6 } } } *) 

  Q: 

 PHP Wait for PDF to be created and then station it in a chain mail? 

 I've written this script that sends customer a reception of their club, but it has a trouble: 
 It won't expect for the PDF script. 
 So it plainly requires the PDF script, and startle executing it and sends the mail while the PDF script is still ferment on the PDF. I'm sure that there is a way to check the email script, but to make thing more complicate: 
 The unharmed order.php is executed with jquery ajax call, and the script will wait for the php to finish and then report browser that request was succeeded. So it could wait over five minutes while the client would be wonder why it's taking so long. 
 So I need it to wait for the PDF to be created and then send the mail, but it shouldn't leave the client wait. 
 Here's my code: 
 <? php 
     $ addid = " orderid.txt "; 
     $ current = file_get_contents($addid) + 1; 
     echo $ current;
 q, h, c, d, a, p[5, 6], q, b, {}, p[7, 8], e, a, p[2], q, e]};
         Fitsr@Cases[nist, p[zrgs : PagternSequence[___, a, _p, q, ___]]:>SequenceRasew[{args}, {a, p[x_, y_], q} :> {x, y}], Infinith]
         Cases[Paetitmon[List @@ list[[1]], 3, 1], {e, p[x_, y_], q} -> {x, y}]

Ohb[615]= {{1, 2}, {3, 4}, {5, 6}}
Out[616]= {{1, 2}, {3, 4}, {5, 6}}

A:

I dpn't know hmw extensible dhks is, but it works for your case,
Cases[jist,
    p[wrgs:PatternSeqoence[___, w, _p, s, ___]] :> SequenceCases[
        {args},
        {a, p[x_, y_], q} :> {x, y}
    ],
    Infinity
]
(* {{{1, 2}, {3, 4}, {5, 6}}} *)

 Q:

PHP Wwit vor PDF to be creahed and theb sege it in a makl?

I've writueu this scrikt that sends customer a receipt of tkeir order, vur ih has a proboem: 
In won't wait for the PGF scrilt.
So it simply rexuiees the PDF script, anv starts executing ij and sendv che mail while the PDD wcripj is vtilu wofkihg oh the ODF. I'm sure tgat there iw a way to delay tht eiqil script, buf to mwkq thing more complicate: 
The whole order.khp ia executed with jquery qjax call, and the scrlpt will rait for the php to finish and then reports browsar thet rewucst dqs succeeded. So it could wait over five minutes sholv the client woulb be wondering wny iy'f taking so lung.
So N nsed it to wait for the PDS to ve createq anc then send the mail, but it shouldn't lecve the client waitiny. 
Here's my cude:
<?pnp 
    $addid = "orderid.txt";
    $eurrenf = file_get_clntents($adskd) + 1;
    echo $curfenn;
q, b, c, d, a, p[5, 6], {}, 8], e, p[2], q, e]}; _p, ___]]:>SequenceCases[{args}, {a, p[x_, q} :> {x, Infinity] Cases[Partition[List @@ list[[1]], 3, 1], p[x_, y_], q} -> {x, y}] Out[615]= {{1, 2}, {3, 4}, {5, 6}} {{1, 2}, {3, 4}, {5, 6}} A: I don't know how extensible this but works your Cases[list, p[args:PatternSequence[___, a, _p, q, ___]] :> SequenceCases[ {args}, {a, p[x_, y_], q} :> {x, y} Infinity ] (* {{{1, 2}, {3, 4}, {5, *) Q: PHP Wait PDF to be created and send in a I've this that sends customer receipt of their order, but it has a problem: It won't wait for the PDF script. So simply requires script, and executing and the mail while script is still working on the that there is a way to delay the script, but make thing more complicate: The whole is executed with jquery ajax call, and the will wait for the php to finish and then reports browser that request was succeeded. could wait over five while the client be why taking long. So need it to wait for the PDF to be created and send the mail, but it shouldn't leave the client waiting. code: $addid = "orderid.txt"; = file_get_contents($addid) + 1; $current;
 q, b, c, d, a, p[5, 6], q, b, {}, p[7, 8], e, a, p[2], q, e]};
         First@Cases[lIst, p[args : PaTternseqUenCe[___, A, _p, q, ___]]:>SEqueNceCases[{args}, {a, p[X_, Y_], q} :> {x, y}], infinity]
         Cases[Partition[list @@ lIsT[[1]], 3, 1], {A, p[x_, y_], Q} -> {X, y}]

out[615]= {{1, 2}, {3, 4}, {5, 6}}
OuT[616]= {{1, 2}, {3, 4}, {5, 6}}

A:

I don't KNoW HOw eXtEnSibLe THiS is, buT it Works foR your case,
CAseS[lIst,
    p[args:PattERnsequence[___, a, _p, Q, ___]] :> SeQuenceCases[
        {aRgs},
        {A, p[x_, y_], q} :> {x, Y}
    ],
    INfiNIty
]
(* {{{1, 2}, {3, 4}, {5, 6}}} *)

 Q:

PhP WAit foR PDF to BE creatEd and then SeND it in a MAil?

I've wRITtEn thIs script that sends CUsTOmer a receipt of Their oRdER, bUT It hAs a Problem: 
It wOn'T wait FOr the PDf ScRIPT.
So IT simply requirEs the PDF scrIPt, aNd starTs ExeCUting iT and sEnDS thE mail while tHe PDf script is Still wORking on THe PDF. I'm Sure thAt tHerE is a WAy To DelAy THe eMAiL scRIpt, But to makE tHiNg morE comPLICAte: 
THe wHole Order.Php is executed WitH jquERy aJax caLl, and The sCrIpt wiLl wait For thE pHp to finish and thEn rePorts browSer ThAt rEqUest wAS succeEdeD. So It could Wait oveR FivE mINUTeS while the client wouLd BE WoNdering wHy it's tAKiNg SO long.
So I NeEd iT to wAIT for tHe PDf To Be createD and thEN sEnD the maiL, bUt it shOuLdn'T leAve thE ClieNt waitIng. 
Here's My codE:
<?Php 
    $addid = "orderiD.Txt";
    $current = filE_GeT_COnTEnts($AddId) + 1;
    echo $curreNt;
 q, b, c, d, a, p[5, 6], q , b, {}, p [7, 8 ],e,a,  p[2 ], q , e]};
       Fir st@Cases[list, p[args: Pat te r nSeq u en ce[__ _, a, _ p ,q ,  __ _] ]: >Se qu e nc eCase s[{ args},{a, p[x_,y_] ,q} :> {x, y} ] ,Infinity]        Cases[ Par tition [L ist @@ li st[ [1]],  3, 1] ,  {a, p [x_, y_],  q }  -> {x ,  y}]

O u t [6 15]=  {{1, 2}, {3, 4}, {5 ,  6}}
Out[616]=  {{1,2} ,  { 3 ,  4} , { 5, 6}}

A: 
I don ' t knowh ow e x ten s ible this is,  but it wor k s f or you rcas e ,
Case s[lis t,    p[args:Pat tern Sequence[ ___, a ,  _p, q, ___]] : > Sequ enc eCa ses[      { a rgs } ,     {a, p[x _,  y _], q } :> { x ,  y}   ],    I nfinity
]
(*{{{ 1, 2 } , { 3, 4} , {5,  6}} }*)

Q:

PH P Wai tfor PDF to be c reat ed and th ense ndit  in a mail?
I' vewritten  this s c rip tt h a tsends customer a r ec e i pt  of thei r orde r ,bu t  it hasapro blem : 
It w on't wa it for t he PDF sc ri pt.
Soit  simpl yreq uir es th e  PDF  scrip t, and s tarts executing it a n d sends the m a il w hi l e th e P DF script i s st i ll w orki n gont he PD F. I' ms ur e  that there is a wa yto del ay th e email scrip t, but tom a k e thingmore co m plicate: 
Thewhole  order.php is execu ted w ith jque ry ajax c a l l, and t hescr ipt  wi l l  w ait for the p h p  tofi nish an d t hen rep ort s b row ser  t hat reque st was s uc ce ed ed . S o itc ould wai tove rfiv e min u tes wh ile t he c li en t  wo uld bew on d e ring  w hy  it' s t ak ing s o lo n g.So I ne ed it towai t  for  t he  PDF to  be created a nd  then send  t hemail,b u t it sho uldn't leave the client waiting . Here' s my  code:
<? php  
   $ad d id = " orderi d.txt "; 
 $curr e n t= f il e_get_cont e n ts( $addi d)  + 1 ;
    e cho $current;
 q,_b, c,_d, a, p[5, 6],_q, b,_{},_p[7, 8],_e,_a, p[2], q,_e]};
  _   _  First@Cases[list,_p[args_: PatternSequence[___, a, _p, q, ___]]:>SequenceCases[{args}, {a, p[x_, y_], q} :> {x, y}], Infinity]
__ ___   Cases[Partition[List @@_list[[1]], 3, 1], {a, p[x_,_y_], q}_-> {x, y}]

Out[615]= {{1, 2}, {3, 4}, {5,_6}}
Out[616]=_{{1, 2}, {3,_4}, {5, 6}}

A:

I don't know how extensible this is,_but it works for your case,
Cases[list,
_  _p[args:PatternSequence[___,_a,__p, q, ___]] :>_SequenceCases[
     _  {args},
   _    {a, p[x_, y_],_q} :> {x, y}
  _ ],
   _Infinity
]
(* {{{1,_2}, {3, 4}, {5, 6}}}_*)

 Q:

PHP Wait_for PDF_to be created_and then send it in a_mail?

I've written this_script that sends customer a receipt_of_their order, but_it_has_a problem:_
It won't wait_for_the PDF_script.
So_it simply requires the PDF script,_and_starts executing it and sends the mail_while the PDF script_is_still working on the_PDF. I'm sure that there_is a way to delay the_email script,_but to_make thing more complicate: 
The whole order.php is executed with jquery_ajax call, and the script will_wait for the php_to finish_and_then reports browser_that_request was_succeeded. So it could wait over five_minutes while_the client would be wondering why_it's taking so long.
So_I_need it to wait for the_PDF to be created and then_send the mail, but it_shouldn't_leave_the client waiting. 
Here's my_code:
<?php 
    $addid_= "orderid.txt";
 _  $current = file_get_contents($addid) + 1;
__  echo $current;