minor #15847 [DomCrawler] Optimize the regex used to find namespace prefixes (stof)
minor #15847 [DomCrawler] Optimize the regex used to find namespace prefixes (stof)

This PR was merged into the 2.7 branch.

Discussion
----------

[DomCrawler] Optimize the regex used to find namespace prefixes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

I ran Blackfire on the [Mink BrowserKitDriver](https://github.com/minkphp/MinkBrowserKitDriver) testsuite (which is a realistic usage of the Mink API btw, as the driver testsuite is basically a functional test of a fixtures website, where failures are considered to be caused by the driver misbehaving).
I discovered that 17% of the time was spent in ``preg_match_all`` to look for prefixes in the XPath namespace prefixes (Mink does not use any namespace prefix in its Xpath queries).

This optimizes the regex to use a possessive quantifier. This avoids useless backtracking when matching (due to the way the regex is written, backtracking cannot allow finding more matches here). See https://blackfire.io/profiles/compare/21aaebf3-e38f-456a-8fc9-cf7d9e2a35eb/graph for the improvement.
The optimization is applied in the 2.7 branch, because this regex does not exist in 2.3: the registration of namespaces was added in 2.4

Commits
-------

02818e4 [DomCrawler] Optimize the regex used to find namespace prefixes

realityking/symfony,frankdejonge/symfony,curry684/symfony,Nyholm/symfony,zcodes/symfony,thunderer/symfony,jelte/symfony,realityking/symfony,kbond/symfony,tronsha/symfony,codeclimate-testing/symfony,davewwww/symfony,SpacePossum/symfony,SofHad/symfony,weaverryan/symfony,docteurklein/symfony,mpdude/symfony,localheinz/symfony,shieldo/symfony,Socratemus/symfony,smatyas/symfony,klandaika/symfony,lstrojny/symfony,romainneutron/symfony,gimler/symfony,Socratemus/symfony,derrabus/symfony,d-ph/symfony,bocharsky-bw/symfony,GuilhemN/symfony,jjanvier/symfony,tgalopin/symfony,yceruto/symfony,zerkms/symfony,ro0NL/symfony,sgehrig/symfony,ro0NL/symfony,superdav42/symfony,tPl0ch/symfony,yceruto/symfony,dbu/symfony,nicolas-grekas/symfony,bendavies/symfony,csarrazi/symfony,havvg/symfony,dmaicher/symfony,natechicago/symfony,pyrech/symfony,WouterJ/symfony,MisatoTremor/symfony,neemzy/symfony,MatTheCat/symfony,andreia/symfony,moycarretero/behat,paradajozsef/symfony,lyrixx/symfony,havvg/symfony,Koc/symfony,beoboo/symfony,georaldc/symfony,hacfi/symfony,gnat42/symfony,pierredup/symfony,backbone87/symfony,AlexDpy/symfony,hichammoad/symfony,damienalexandre/symfony,bburnichon/symfony,Simperfit/symfony,Engerim/symfony,moycarretero/behat,stof/symfony,jakzal/symfony,kbond/symfony,tekjava/symfony,jvasseur/symfony,GuilhemN/symfony,georaldc/symfony,Ener-Getick/symfony,pyrech/symfony,MAXakaWIZARD/symfony,davewwww/symfony,webmozart/symfony,bocharsky-bw/symfony,c960657/symfony,tPl0ch/symfony,tucksaun/symfony,Koc/symfony,damienalexandre/symfony,calm10/Symfony2,romaricdrigon/symfony,bburnichon/symfony,chalasr/symfony,dosten/symfony,nasimnabavi/symfony,ewgRa/symfony,paradajozsef/symfony,Ocramius/symfony,andrerom/symfony,beoboo/symfony,unexge/symfony,SaschaDens/symfony,Nyholm/symfony,hhamon/symfony,linovarona/symfony,fabpot/symfony,gencer/symfony,MisatoTremor/symfony,razmo/symfony,okdana/symfony,Tobion/symfony,curry684/symfony,Aliance/symfony,hhamon/symfony,sgehrig/symfony,tekjava/symfony,nasimnabavi/symfony,peterjmit/symfony,jakzal/symfony,tekjava/symfony,derrabus/symfony,tekjava/symfony,adamelso/symfony,aeoris/symfony,peterrehm/symfony,Tobion/symfony,razmo/symfony,jamyouss/symfony,Aliance/symfony,andreia/symfony,nicolas-grekas/symfony,symfony/symfony,Tobion/symfony,Triiistan/symfony,bburnichon/symfony,Ocramius/symfony,voronkovich/symfony,vincentaubert/symfony,linovarona/symfony,wilderguzman/symfony,alekitto/symfony,raziel057/symfony,dkarvounaris/symfony,josephdpurcell/symfony,tronsha/symfony,mvhirsch/symfony,linovarona/symfony,Rvanlaak/symfony,Ener-Getick/symfony,dzuelke/symfony,mvhirsch/symfony,damienalexandre/symfony,Amo/symfony,realityking/symfony,Strate/symfony,tecnocat/symfony,realityking/symfony,yinhe007/symfony,dosten/symfony,ogizanagi/symfony,adamelso/symfony,wilderguzman/symfony,lemoinem/symfony,ajgarlag/symfony,localheinz/symfony,Ener-Getick/symfony,Amo/symfony,ogizanagi/symfony,alebo/symfony,calm10/Symfony2,romainneutron/symfony,e-moe/symfony,zorn-v/symfony,fabpot/symfony,peterrehm/symfony,mihai-stancu/symfony,unexge/symfony,apfelbox/symfony,OndraM/symfony,patrick-mcdougle/symfony,believer-ufa/symfony,alebo/symfony,mihai-stancu/symfony,tronsha/symfony,peterjmit/symfony,jeremyFreeAgent/symfony,weaverryan/symfony,neemzy/symfony,SofHad/symfony,jakubsacha/symfony,oleg-andreyev/symfony,arjenm/symfony,Nyholm/symfony,joelwurtz/symfony,phramz/symfony,lyrixx/symfony,jvasseur/symfony,stof/symfony,ro0NL/symfony,xabbuh/symfony,apfelbox/symfony,sstok/symfony,symfony/symfony,mmauri04/symfony,zerkms/symfony,Strate/symfony,geoffrey-brier/symfony,unexge/symfony,WhiteEagle88/symfony,zerustech/symfony,lepiaf/symfony,realityking/symfony,garak/symfony,deguif/symfony,weaverryan/symfony,tucksaun/symfony,Restless-ET/symfony,localheinz/symfony,inso/symfony,frankdejonge/symfony,ewgRa/symfony,Engerim/symfony,nasimnabavi/symfony,beoboo/symfony,moycarretero/behat,mickaelandrieu/symfony,nasimnabavi/symfony,garak/symfony,1ed/symfony,ajgarlag/symfony,dunglas/symfony,razmo/symfony,beoboo/symfony,thunderer/symfony,Koc/symfony,linovarona/symfony,Amo/symfony,Triiistan/symfony,andrerom/symfony,josephdpurcell/symfony,andrerom/symfony,codeclimate-testing/symfony,klandaika/symfony,klandaika/symfony,okdana/symfony,patrick-mcdougle/symfony,zerustech/symfony,michaelperrin/symfony,unexge/symfony,gencer/symfony,jelte/symfony,jelte/symfony,Taluu/symfony,moycarretero/behat,mnapoli/symfony,bocharsky-bw/symfony,jvasseur/symfony,SpacePossum/symfony,mweimerskirch/symfony,jameshalsall/symfony,webmozart/symfony,k0pernikus/symfony,digitalkaoz/symfony,howtolearntocode/symfony,peterjmit/symfony,bocharsky-bw/symfony,cvuorinen/symfony,e-moe/symfony,Ocramius/symfony,tekjava/symfony,jeremyFreeAgent/symfony,Padam87/symfony,webmozart/symfony,symfony/symfony,mweimerskirch/symfony,superdav42/symfony,geoffrey-brier/symfony,paradajozsef/symfony,tecnocat/symfony,nicolas-grekas/symfony,superdav42/symfony,OndraM/symfony,datagit/symfony,natechicago/symfony,arjenm/symfony,Triiistan/symfony,joelwurtz/symfony,jeremyFreeAgent/symfony,michaelperrin/symfony,lemoinem/symfony,Slamdunk/symfony,maidmaid/symfony,Slamdunk/symfony,Simperfit/symfony,pix-art/symfony,e-moe/symfony,damienalexandre/symfony,backbone87/symfony,mweimerskirch/symfony,OndraM/symfony,Simperfit/symfony,ajgarlag/symfony,Koc/symfony,Pierstoval/symfony,sstok/symfony,hhamon/symfony,mweimerskirch/symfony,gonzalovilaseca/symfony,calm10/Symfony2,gencer/symfony,paradajozsef/symfony,adamelso/symfony,gimler/symfony,oleg-andreyev/symfony,inso/symfony,dzuelke/symfony,OskarStark/symfony,chrisguitarguy/symfony,tecnocat/symfony,lstrojny/symfony,alekitto/symfony,Soullivaneuh/symfony,jamyouss/symfony,inso/symfony,kbond/symfony,jakubsacha/symfony,patrick-mcdougle/symfony,ragboyjr/symfony,Amo/symfony,pamil/symfony,mweimerskirch/symfony,Taluu/symfony,ragboyjr/symfony,stof/symfony,phramz/symfony,webmozart/symfony,chalasr/symfony,Pierstoval/symfony,mickaelandrieu/symfony,pix-art/symfony,jameshalsall/symfony,havvg/symfony,wilderguzman/symfony,iltar/symfony,romainneutron/symfony,apetitpa/symfony,derrabus/symfony,jelte/symfony,Taluu/symfony,calm10/Symfony2,hacfi/symfony,Taluu/symfony,sgehrig/symfony,pix-art/symfony,shieldo/symfony,raziel057/symfony,craue/symfony,georaldc/symfony,OskarStark/symfony,1ed/symfony,e-moe/symfony,jderusse/symfony,moycarretero/behat,dmaicher/symfony,Einenlum/symfony,Padam87/symfony,hason/symfony,inso/symfony,jean-gui/symfony,Slamdunk/symfony,hason/symfony,AlexDpy/symfony,nicolas-grekas/symfony,michaelperrin/symfony,joelwurtz/symfony,xabbuh/symfony,xabbuh/symfony,thunderer/symfony,ewgRa/symfony,patrick-mcdougle/symfony,hiddewie/symfony,peterrehm/symfony,dzuelke/symfony,yinhe007/symfony,pierredup/symfony,d-ph/symfony,peterrehm/symfony,Strate/symfony,mickaelandrieu/symfony,mpdude/symfony,curry684/symfony,mickaelandrieu/symfony,EVODelavega/symfony,stof/symfony,DavidGarciaCat/symfony,cvuorinen/symfony,bendavies/symfony,pamil/symfony,Pierstoval/symfony,sroze/symfony,pamil/symfony,hiddewie/symfony,codeclimate-testing/symfony,apfelbox/symfony,pamil/symfony,adamelso/symfony,deguif/symfony,andreia/symfony,1ed/symfony,apetitpa/symfony,believer-ufa/symfony,jjanvier/symfony,WouterJ/symfony,sstok/symfony,Slamdunk/symfony,dmaicher/symfony,danionut90/symfony,MisatoTremor/symfony,jpauli/symfony,dkarvounaris/symfony,ogizanagi/symfony,chrisguitarguy/symfony,SofHad/symfony,oleg-andreyev/symfony,SofHad/symfony,iltar/symfony,dawehner/symfony,Ocramius/symfony,shieldo/symfony,romainneutron/symfony,jakubsacha/symfony,dunglas/symfony,georaldc/symfony,tronsha/symfony,OndraM/symfony,raziel057/symfony,andrerom/symfony,aeoris/symfony,mnapoli/symfony,Padam87/symfony,dkarvounaris/symfony,howtolearntocode/symfony,kbond/symfony,EVODelavega/symfony,SaschaDens/symfony,alekitto/symfony,AlexDpy/symfony,smatyas/symfony,jeremyFreeAgent/symfony,Soullivaneuh/symfony,DavidGarciaCat/symfony,jjanvier/symfony,calm10/Symfony2,danionut90/symfony,k0pernikus/symfony,tecnocat/symfony,havvg/symfony,superdav42/symfony,peterjmit/symfony,klandaika/symfony,josephdpurcell/symfony,datagit/symfony,apfelbox/symfony,Einenlum/symfony,SofHad/symfony,zerustech/symfony,jderusse/symfony,jjanvier/symfony,aeoris/symfony,mvhirsch/symfony,Deamon/symfony,MatTheCat/symfony,OndraM/symfony,unexge/symfony,gimler/symfony,mpdude/symfony,ewgRa/symfony,jelte/symfony,natechicago/symfony,datagit/symfony,tronsha/symfony,jpauli/symfony,OskarStark/symfony,dosten/symfony,MAXakaWIZARD/symfony,cvuorinen/symfony,bburnichon/symfony,Ener-Getick/symfony,maidmaid/symfony,SaschaDens/symfony,d-ph/symfony,yceruto/symfony,sgehrig/symfony,Aliance/symfony,dawehner/symfony,ajgarlag/symfony,csarrazi/symfony,Rvanlaak/symfony,Rvanlaak/symfony,OskarStark/symfony,jpauli/symfony,sstok/symfony,jean-gui/symfony,Soullivaneuh/symfony,dzuelke/symfony,bocharsky-bw/symfony,zcodes/symfony,zorn-v/symfony,zerkms/symfony,Einenlum/symfony,dkarvounaris/symfony,davewwww/symfony,natechicago/symfony,mmauri04/symfony,Deamon/symfony,bburnichon/symfony,mihai-stancu/symfony,lstrojny/symfony,jzawadzki/symfony,datagit/symfony,MAXakaWIZARD/symfony,jderusse/symfony,inso/symfony,Soullivaneuh/symfony,howtolearntocode/symfony,fabpot/symfony,HeahDude/symfony,believer-ufa/symfony,ragboyjr/symfony,geoffrey-brier/symfony,Nyholm/symfony,zorn-v/symfony,teohhanhui/symfony,voronkovich/symfony,mvhirsch/symfony,HeahDude/symfony,jakubsacha/symfony,Pierstoval/symfony,Einenlum/symfony,howtolearntocode/symfony,realityking/symfony,mnapoli/symfony,peterrehm/symfony,csarrazi/symfony,hacfi/symfony,docteurklein/symfony,EVODelavega/symfony,MatTheCat/symfony,jean-gui/symfony,zerustech/symfony,Amo/symfony,natechicago/symfony,MatTheCat/symfony,frankdejonge/symfony,dbu/symfony,EVODelavega/symfony,superdav42/symfony,gnat42/symfony,georaldc/symfony,symfony/symfony,zorn-v/symfony,maidmaid/symfony,davewwww/symfony,jameshalsall/symfony,WhiteEagle88/symfony,sroze/symfony,gonzalovilaseca/symfony,danionut90/symfony,jamyouss/symfony,yinhe007/symfony,iltar/symfony,geoffrey-brier/symfony,iltar/symfony,Simperfit/symfony,docteurklein/symfony,howtolearntocode/symfony,hichammoad/symfony,natechicago/symfony,teohhanhui/symfony,mpdude/symfony,tucksaun/symfony,joelwurtz/symfony,dzuelke/symfony,docteurklein/symfony,tucksaun/symfony,SpacePossum/symfony,dosten/symfony,patrick-mcdougle/symfony,docteurklein/symfony,tgalopin/symfony,jamyouss/symfony,chalasr/symfony,voronkovich/symfony,pyrech/symfony,lyrixx/symfony,SpacePossum/symfony,dkarvounaris/symfony,lemoinem/symfony,alebo/symfony,pix-art/symfony,smatyas/symfony,yinhe007/symfony,lepiaf/symfony,jderusse/symfony,apetitpa/symfony,sroze/symfony,voronkovich/symfony,danionut90/symfony,hhamon/symfony,sstok/symfony,xabbuh/symfony,teohhanhui/symfony,datagit/symfony,geoffrey-brier/symfony,tgalopin/symfony,pierredup/symfony,neemzy/symfony,Deamon/symfony,jakzal/symfony,mmauri04/symfony,vincentaubert/symfony,hichammoad/symfony,mmauri04/symfony,ewgRa/symfony,Simperfit/symfony,Restless-ET/symfony,apetitpa/symfony,jvasseur/symfony,digitalkaoz/symfony,linovarona/symfony,Triiistan/symfony,GuilhemN/symfony,andreia/symfony,jameshalsall/symfony,mmauri04/symfony,AlexDpy/symfony,MAXakaWIZARD/symfony,c960657/symfony,deguif/symfony,jeremyFreeAgent/symfony,phramz/symfony,believer-ufa/symfony,jjanvier/symfony,dmaicher/symfony,alekitto/symfony,Ocramius/symfony,adamelso/symfony,mickaelandrieu/symfony,pix-art/symfony,pyrech/symfony,AlexDpy/symfony,jzawadzki/symfony,jameshalsall/symfony,mnapoli/symfony,vincentaubert/symfony,lepiaf/symfony,hason/symfony,zerkms/symfony,cvuorinen/symfony,Deamon/symfony,mvhirsch/symfony,jpauli/symfony,beoboo/symfony,mihai-stancu/symfony,fabpot/symfony,Socratemus/symfony,WouterJ/symfony,believer-ufa/symfony,gonzalovilaseca/symfony,alebo/symfony,tPl0ch/symfony,webmozart/symfony,geoffrey-brier/symfony,hiddewie/symfony,dosten/symfony,arjenm/symfony,pix-art/symfony,lemoinem/symfony,zcodes/symfony,Padam87/symfony,backbone87/symfony,Restless-ET/symfony,k0pernikus/symfony,romaricdrigon/symfony,DavidGarciaCat/symfony,digitalkaoz/symfony,codeclimate-testing/symfony,SpacePossum/symfony,jakzal/symfony,bendavies/symfony,mnapoli/symfony,razmo/symfony,ogizanagi/symfony,vincentaubert/symfony,tecnocat/symfony,hiddewie/symfony,craue/symfony,smatyas/symfony,klandaika/symfony,georaldc/symfony,danionut90/symfony,frankdejonge/symfony,arjenm/symfony,curry684/symfony,dunglas/symfony,WhiteEagle88/symfony,davewwww/symfony,gnat42/symfony,gimler/symfony,michaelperrin/symfony,garak/symfony,jpauli/symfony,jpauli/symfony,SaschaDens/symfony,razmo/symfony,jamyouss/symfony,jzawadzki/symfony,jean-gui/symfony,teohhanhui/symfony,tgalopin/symfony,shieldo/symfony,ewgRa/symfony,believer-ufa/symfony,thunderer/symfony,SaschaDens/symfony,Soullivaneuh/symfony,tPl0ch/symfony,mihai-stancu/symfony,EVODelavega/symfony,MAXakaWIZARD/symfony,c960657/symfony,gnat42/symfony,Ener-Getick/symfony,thunderer/symfony,havvg/symfony,MisatoTremor/symfony,chalasr/symfony,1ed/symfony,dbu/symfony,MisatoTremor/symfony,zcodes/symfony,chrisguitarguy/symfony,phramz/symfony,localheinz/symfony,MisatoTremor/symfony,k0pernikus/symfony,Ener-Getick/symfony,Socratemus/symfony,derrabus/symfony,wilderguzman/symfony,superdav42/symfony,sroze/symfony,peterjmit/symfony,dawehner/symfony,garak/symfony,raziel057/symfony,Rvanlaak/symfony,hichammoad/symfony,GuilhemN/symfony,weaverryan/symfony,Deamon/symfony,tronsha/symfony,HeahDude/symfony,deguif/symfony,yceruto/symfony,dbu/symfony,jakubsacha/symfony,danionut90/symfony,Engerim/symfony,k0pernikus/symfony,bendavies/symfony,c960657/symfony,digitalkaoz/symfony,romainneutron/symfony,apfelbox/symfony,yinhe007/symfony,wilderguzman/symfony,maidmaid/symfony,okdana/symfony,Tobion/symfony,cvuorinen/symfony,romaricdrigon/symfony,Socratemus/symfony,chrisguitarguy/symfony,dawehner/symfony,GuilhemN/symfony,digitalkaoz/symfony,zerustech/symfony,Restless-ET/symfony,Ocramius/symfony,Rvanlaak/symfony,hiddewie/symfony,dbu/symfony,lemoinem/symfony,Padam87/symfony,Triiistan/symfony,Restless-ET/symfony,oleg-andreyev/symfony,HeahDude/symfony,gonzalovilaseca/symfony,hichammoad/symfony,smatyas/symfony,alebo/symfony,tPl0ch/symfony,lyrixx/symfony,chrisguitarguy/symfony,raziel057/symfony,ro0NL/symfony,craue/symfony,romaricdrigon/symfony,d-ph/symfony,dawehner/symfony,pierredup/symfony,ragboyjr/symfony