EmailDetect Library - A simple solution to detect emails into strings. |
[eluser]Colin Williams[/eluser]
Quote:has a syntax.error (the final ^) and should better try the modified one No, actually the two ^ characters are the regex delimiters. Whoever wrote that regex decided to use ^regex^ instead of /regex/ for some reason.
[eluser]gungbao[/eluser]
ah okay, thanks. never saw that before and I have done quiet much with regex - i am only comfortable with the /regex/i syntax, I think its confusing cause also the ^ marks the beginning and the $ the end. @armorfist: please do not buy the oreilly book, its really too hardly diving into the regex. I found personally the best regex leson in the famous PHP Book from famous "we all thank you" Mr. "Rasmus Leerdorf". Regex gets even more powerful, when you are using them in your mysql-queries, its not always the best performance solution there - but you can really do fancy stuff with just a bit of codedust.
[eluser]Armorfist[/eluser]
[quote author="Colin Williams" date="1221206877"] Quote:has a syntax.error (the final ^) and should better try the modified one No, actually the two ^ characters are the regex delimiters. Whoever wrote that regex decided to use ^regex^ instead of /regex/ for some reason.[/quote] Can you tell me the difference between ^ ^ and / /? Thanks.
[eluser]gungbao[/eluser]
as colin said, there is no difference. personally I never saw this & i find this confusing, where ^ has already anchor and negotion behavior. as colin said - "for some reason ![]() here is a nice cheatsheet to start wit preg's http://support.sas.com/rnd/base/datastep...-sheet.pdf more about perl and posix regex on the php.net there are even online-tools to click&build;your regex and check the matching on-the-fly.
[eluser]gungbao[/eluser]
and here is an interesting word to what colin mentioned: http://www.perlfect.com/articles/regex.shtml so it should still have a leading "m^my_regex^" to meet the syntax - shouldn't it? amazingly confusing for just nothing. better choose an "m{my_regex}" or there is just nothing confusing in the "/my_regex/i" on the above mentioned expression. always learning - thanks to this wise forum - thanks.
[eluser]Joel Wallis[/eluser]
huauhuhuhahuuahhaha I posted my daughter CI class and i created a 'Regex War' ![]() JemGames, let's think about... To use explode at this occasion? I should to tell character-by-character to the explode make your work. Using Regular Expressions you have a more faster processing, and you tell: "Hey PHP, ANYTHING that is not a alphanumeric, a dot, a '@', a '-' or an underscore is a delimiter!", so you don't should to tell the characters list to explode it. Do you understand? Today i was reading the EmailDetect code again (today i'm not at work), and i should to tell a notice that maybe isn't very good... I posted my old code ![]() Sorry, sorry! I will rewrite it right now and i'll post here. ![]()
[eluser]sophistry[/eluser]
this is a better email finder regex: http://ellislab.com/forums/viewthread/89516/ |
Welcome Guest, Not a member yet? Register Sign In |