Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular expressions middle of string

Tags:

regex

How I can get part of SIP URI? For example I have URI sip:[email protected], I need get just username and I use [^sip:](.*)[$@]+ expression, but appeared result is username@. How I can exclude from matching @?

like image 368
NikedLab Avatar asked Dec 26 '22 07:12

NikedLab


1 Answers

this should do the job

(?<=^sip:)(.*)(?=[$@])
like image 51
VladL Avatar answered Dec 28 '22 21:12

VladL