REGEX Match everything but / which starts with :

Aredosheedo

New Member
i am writing a regular expression which should do the following:Match everything which is not a /
Dont match if matched segment starts with :Example:asdjhas/*fdjkl*/sdfds:dsfsdf/:sdff/sdffffThe bolded parts should match with the regex. As you can see, all forward slashes are not matched as well as the part which starts with a : only.I have come up with this: ([^/]+) which works as intended except it will also match parts that start with :. I tried using negative lookahead assertions but to be honest, i really do not understand them.I am also using PHPs preg library to do the matching for me.Thanks
 
Back
Top