Author Topic: The merged OmnomIRC lines glitch is back  (Read 7447 times)

0 Members and 1 Guest are viewing this topic.

Offline Netham45

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2103
  • Rating: +213/-4
  • *explodes*
    • View Profile
Re: The merged OmnomIRC lines glitch is back
« Reply #15 on: May 02, 2011, 04:20:49 am »
The power of regex's. :P
Omnimaga Admin

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: The merged OmnomIRC lines glitch is back
« Reply #16 on: May 02, 2011, 04:22:06 am »
That looks more cryptic than z80 assembly! O.O

It's really not. RegEx is actually fairly easy to learn, and it proves to be VERY useful in some situations. You really should at least take a look at it. :P

Edit: here's a link if you feel like checking it out http://www.regular-expressions.info/tutorial.html
« Last Edit: May 02, 2011, 04:26:26 am by ZippyDee »
There's something about Tuesday...


Pushpins 'n' stuff...


Offline Netham45

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2103
  • Rating: +213/-4
  • *explodes*
    • View Profile
Re: The merged OmnomIRC lines glitch is back
« Reply #17 on: May 02, 2011, 04:32:59 am »
Yea, I simplified a 300+ line script into about 120 using regex's.
Omnimaga Admin

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: The merged OmnomIRC lines glitch is back
« Reply #18 on: May 02, 2011, 04:48:38 am »
Exactly! And it's especially useful for things such as IRC where the content of each part changes (for instance the nick of the person speaking) but the restrictions stay the same (it only allows letters and numbers and undercore...and I guess in the case of OmnomIRC also  ?)

In that case, you can use regex like something as simple as "</w+>" to capture the name found within < and > in a message.
(In regex, anything followed by + tells it to look for 1 or more of that character/character-group. /w represents the character group [A-Za-z0-9_]).

Obviously that's a very general example, but still
« Last Edit: May 02, 2011, 04:48:53 am by ZippyDee »
There's something about Tuesday...


Pushpins 'n' stuff...


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: The merged OmnomIRC lines glitch is back
« Reply #19 on: May 02, 2011, 02:29:47 pm »
Ah ok, it just seemed weird at first glance, like if it was just a bunch of random chars together. :P

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The merged OmnomIRC lines glitch is back
« Reply #20 on: May 07, 2011, 10:54:39 pm »
You're right, I can see it used everywhere O.O