replace characters by regExp with exclude
How can I match first letters and also if the letter is precedded by period, comma or colon (even with no space between), but not if the letter is preceded by a quote or dubble quote.
Ex: abcd e'fgh hj"kl mno.p q:rst uv,wx
The match should be a,e,h,m,p,q,q,r,u,w (excluding f,k)
var m=this.match(/^[^a-zA-Z]*(([a-zA-Z])|[\. ,:]([a-zA-Z]))/g
Last edited by mrhoo; 09-03-2009 at 11:03 AM.
Thx for reply.
What if I want to replace these matched letters with space? Can I use string.replace on this?
your pattern seems not to work. I pasted it on http://www.gskinner.com/RegExr/ and only the first letter of the string is matched.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread