User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Pearl - String Matching Page [1]  
Novicane
All American
15416 Posts
user info
edit post

I'm having trouble finding examples of regular expressions in Pearl.

anyone have any links to sites?

2/1/2007 12:09:44 PM

spöokyjon

18617 Posts
user info
edit post

Maybe you should search under "perl".

2/1/2007 12:28:55 PM

BobbyDigital
Thots and Prayers
41777 Posts
user info
edit post

hahahhahaha

beautiful.

2/1/2007 12:30:21 PM

OmarBadu
zidik
25071 Posts
user info
edit post

Maybe you should search under "perl".

2/1/2007 12:50:05 PM

8=======D
Suspended
588 Posts
user info
edit post

perhaps you should try searching for "perl"

2/1/2007 1:17:18 PM

Novicane
All American
15416 Posts
user info
edit post

hahaha my bad

you know what i mean

2/1/2007 1:24:55 PM

LimpyNuts
All American
16859 Posts
user info
edit post

other languages have implementations of regular expressions as well. if you already know how to implement regular expressions and are instead trying to find the right search string, then i would recommend leaving out "perl" altogether.

http://www.regular-expressions.info/

2/1/2007 2:34:05 PM

darkone
(\/) (;,,,;) (\/)
11610 Posts
user info
edit post

Just remember that regular expression are not consistant from one language to the next.... much to my annoyance.

2/1/2007 2:35:42 PM

SandSanta
All American
22435 Posts
user info
edit post

You have to look harder. The internet has just about every kind of regex you want including resources dedicated on the matter. The best way to learn it is by understanding how perl's regex engine works and writing some test code.

2/1/2007 2:37:42 PM

LimpyNuts
All American
16859 Posts
user info
edit post

To match an email address, try this:

(??:\r\n)?[ \t])*(???:[^()<>@,;:\\".\[\] \x00-\x1F]+(??:
(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.
|(??:\r\n)?[ \t]))*"(??:\r\n)?[ \t])*)(?:\.(??:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(???:\r\n)?[ \t])+|\Z|(?=
[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(??:\r\n)?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()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?
:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \x0
0-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?
:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \x00
-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*))*
)?;\s*)

2/1/2007 2:41:02 PM

quagmire02
All American
44225 Posts
user info
edit post

haha, emoticons

2/1/2007 2:41:57 PM

tjoshea
All American
4906 Posts
user info
edit post

man perlretut

2/1/2007 3:59:40 PM

WolfAce
All American
6458 Posts
user info
edit post

Quote :
"You have to look harder. The internet has just about every kind of regex you want including resources dedicated on the matter. The best way to learn it is by understanding how perl's regex engine works and writing some test code."


Damn straight. Google is your friend.

2/1/2007 4:23:48 PM

qntmfred
retired
40726 Posts
user info
edit post

rofl@Pearl

2/1/2007 5:10:18 PM

 Message Boards » Tech Talk » Pearl - String Matching Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.