Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript RegEx
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 01 March 2005 :  09:40:24  Show Profile
Need a quick bit of help from those more knowledgable of these things then I. I've got a javascript array of smilies which are going to be read into a regular expression to work around case sensitivity. Trouble is I don't have a clue how to go about doing so! Here's the array, if anyone can help:
("[:)]","[}:)]","[:~]","[:x]","[8D]","[@p]","[:I]","[}D]","[:D]","[&O]","[:{}]","[x:(]","[:p]","[:(]","[:O]","[:|]","[;)]","[8b]","[>p]","[[)]")
From what little experience I do have with regular expressions, would I be right in saying there's a couple of reserved characters in there which need to be escaped?

Oh, and while I'm at it, if anyone has a link to an idiot's guide to RegExs (in VBScript & Javascript), it would be of great help to me. Cheers

<edit> Oop, forgot to stop those smilies from being replced by this forum! </edit>


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 01 March 2005 10:43:26

Podge
Support Moderator

Ireland
3775 Posts

Posted - 01 March 2005 :  10:40:39  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
You might find this helpful

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

http://regex.osherove.com/ (free tool)

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 01 March 2005 :  10:44:38  Show Profile
Cheers, Podge *clicks*


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 01 March 2005 :  11:49:44  Show Profile
Nice link that, that the first one - finally managed to escape the reserved characters after screaming at it for a few minutes when it wouldn't work ... then I remembered I was using javascript and had to use double back slashes! Now, onto removing case sensitivity.

Thanks again, Podge


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 01 March 2005 :  12:25:01  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
You're welcome.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  07:05:02  Show Profile
I think I've just fallen in love with regular expressions Going to spend some time this weekend getting to grips with them properly. Would I be correct in my assumption that regexs are more efficient than VBScript replaces?


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07