mIRC Home    About    Download    Register    News    Help

Print Thread
Regex simplified? #9275 01/02/03 11:28 PM
Joined: Feb 2003
Posts: 4
T
torokokill Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Feb 2003
Posts: 4
Anyone know of a site where I can get regular expressions simplified. All the sites I've googled are just really confusing. If you wanna be really nice, you could make a simple regex which would find ip:port
for example:
53.234.674.920:27886 (purely imaginary ip & port)

Re: Regex simplified? #9276 02/02/03 12:12 AM
Joined: Jan 2003
Posts: 94
S
Sabby Offline
Babel fish
Offline
Babel fish
S
Joined: Jan 2003
Posts: 94


-
E-Mail: mirc_sabby@hotmail.com
Network: irc.enterthegame.com
Channel: #Helpdesk
Re: Regex simplified? #9277 02/02/03 07:28 PM
Joined: Dec 2002
Posts: 3,127
P
ParaBrat Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: Dec 2002
Posts: 3,127
You mite also check this web page (thanks and a cookie to Todd grin )


ParaBrat @#mIRCAide DALnet
Re: Regex simplified? #9278 06/02/03 10:12 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Why would you need regex there? A simple gettok would be easier and faster. And as for "simplifying regex" thats like saying "Can you teach me Calculus in 20 minutes?" The descriptions are complex because regex is, in and of itself complex.

Re: Regex simplified? #9279 07/02/03 12:32 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

alias portIP {
  $regex(portIP,$1-,([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,5}))
  return $regml(portIP,1)
}

//echo $color(info) -abflirt * $$portIP(This is a test 12.34.56.78:80 blah blah)
* 12.34.56.78:80


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: Regex simplified? #9280 12/02/03 11:27 AM
Joined: Feb 2003
Posts: 30
A
Algorithms Offline
Ameglian cow
Offline
Ameglian cow
A
Joined: Feb 2003
Posts: 30
Quote:
The descriptions are complex because regex is, in and of itself complex.

Regular expressions themselves are actually very simple, but can be combined to create complex expressions. This is by design allowing you to easily represent simple patterns such as *.exe very easily, without needing to know how regular expressions work. smirk

Oh, and I can teach you the basics of calculus in 20 minutes :tongue:


Bluesock - Better than a redhat.
http://www.bluesock.com
Re: Regex simplified? #9281 12/02/03 04:25 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I wouldn't call regular expressions easy. It takes some time for most people to wrap their head around the unfamiliar syntax and some of the ideas it introduces. Add the fact that there are several variants all coming under the general heading 'regular expressions', often with no indication of which is being used in a given document, and the whole thing seems a bit daunting when someone first gets started.


Spelling mistakes, grammatical errors, and stupid comments are intentional.