Re: [jQuery] regular expressions

2007-03-07 Thread Ⓙⓐⓚⓔ
1 command , 2 replaces var newString = oldString.replace(/X/,-).replace(/Y/,) On 3/7/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote: hello! I'm experimenting with regular expressions, and i would like to replace in a string some special characters by a - minus sign, and others by just

[jQuery] regular expressions

2007-03-07 Thread Alexandre Plennevaux
hello! I'm experimenting with regular expressions, and i would like to replace in a string some special characters by a - minus sign, and others by just removing it. Do i need ot make two regex.replace(), or is it possible to have both in one command? thank you very much for your time!

Re: [jQuery] regular expressions

2007-03-07 Thread Alexandre Plennevaux
Ah, the jQuery way, of course :) Thanks Jake -Original Message- From: Ⓙⓐⓚⓔ [mailto:[EMAIL PROTECTED] Sent: jeudi 8 mars 2007 0:48 To: [EMAIL PROTECTED]; jQuery Discussion. Subject: Re: [jQuery] regular expressions 1 command , 2 replaces var newString = oldString.replace(/X

Re: [jQuery] regular expressions

2007-03-07 Thread Matt Stith
Quick tut: Just typing something out, eg, /abcd/ would replace anything that contained the exact string abcd, case sensative. If you do /[abcd]/, notice the brackets, it will select the letter a, the letter b, etc. For ranges you can do something like /[a-d]/, which would do the same as

Re: [jQuery] regular expressions

2007-03-07 Thread Ⓙⓐⓚⓔ
and while we're at it, you can use a function as the second parameter! oldString.replace(/[bad or dashable chars]+/g, function (str) { return (str.match(/^[dashable chars]$/) ? - : ) } ) 1 command 1 replace! On 3/7/07,

Re: [jQuery] regular expressions

2007-03-07 Thread Alexandre Plennevaux
Discussion. Subject: Re: [jQuery] regular expressions Quick tut: Just typing something out, eg, /abcd/ would replace anything that contained the exact string abcd, case sensative. If you do /[abcd]/, notice the brackets, it will select the letter a, the letter b, etc. For ranges you can do

Re: [jQuery] Regular Expressions

2006-12-29 Thread himynameiznate
bump? himynameiznate wrote: This may have been answered somewhere, but alas, I cannot find it. I would like to use a regular expression to filter through certain dom elements, but Im not sure if jQuery takes regex. Also, it might be possible with attribute selectors, but Im not sure how.

Re: [jQuery] Regular Expressions

2006-12-29 Thread Jörn Zaefferer
himynameiznate schrieb: This may have been answered somewhere, but alas, I cannot find it. I would like to use a regular expression to filter through certain dom elements, but Im not sure if jQuery takes regex. Also, it might be possible with attribute selectors, but Im not sure how. I want

[jQuery] Regular Expressions

2006-12-28 Thread himynameiznate
This may have been answered somewhere, but alas, I cannot find it. I would like to use a regular expression to filter through certain dom elements, but Im not sure if jQuery takes regex. Also, it might be possible with attribute selectors, but Im not sure how. I want to grab all divs with an ID