Welcome Guest, Not a member yet? Register   Sign In
EmailDetect Library - A simple solution to detect emails into strings.
#11

[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.
#12

[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.
#13

[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.
#14

[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 Smile better forget this redundat way of delimiters and start using the /regex/ when using perl-regex in php (you have to slighlty differ between the preg and the posix - regex in php.

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.
#15

[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.
#16

[eluser]Joel Wallis[/eluser]
huauhuhuhahuuahhaha
I posted my daughter CI class and i created a 'Regex War' Tongue

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 Tongue
Sorry, sorry! I will rewrite it right now and i'll post here. Big Grin
#17

[eluser]sophistry[/eluser]
this is a better email finder regex:

http://ellislab.com/forums/viewthread/89516/




Theme © iAndrew 2016 - Forum software by © MyBB