filter expression for quote (") only in the first postition?

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

filter expression for quote (") only in the first postition?

Postby tgeery » Fri Nov 05, 2010 11:54 am

I'm not a coder and I've played around a little trying to figure something out with no real success... what I'm after is a filter expression that would find a quote character (") only in the first position of the subject field and then exclude that post if the character were found. can anyone suggest something that would work?
User avatar
tgeery
Seasoned User
Seasoned User
 
Posts: 261
Joined: Thu Jul 07, 2005 8:25 am
Location: Northern VA, USA

Registered Newsbin User since: 07/12/05

Re: filter expression for quote (") only in the first postit

Postby richy99 » Fri Nov 05, 2010 12:29 pm

the ^ is the regex for begins with

so might try ^"
User avatar
richy99
Elite NewsBin User
Elite NewsBin User
 
Posts: 6353
Joined: Fri Nov 21, 2003 8:04 pm
Location: Wales

Registered Newsbin User since: 12/31/03

Re: filter expression for quote (") only in the first postit

Postby tgeery » Fri Nov 05, 2010 12:32 pm

I'll give that a try. thanks.
User avatar
tgeery
Seasoned User
Seasoned User
 
Posts: 261
Joined: Thu Jul 07, 2005 8:25 am
Location: Northern VA, USA

Registered Newsbin User since: 07/12/05

Re: filter expression for quote (") only in the first postit

Postby tgeery » Fri Nov 05, 2010 12:40 pm

had to use ^/" since the quote is a special character, I guess. the filter complained unless I used the / but that worked! simple! thanks for the suggestion!
User avatar
tgeery
Seasoned User
Seasoned User
 
Posts: 261
Joined: Thu Jul 07, 2005 8:25 am
Location: Northern VA, USA

Registered Newsbin User since: 07/12/05

Re: filter expression for quote (") only in the first postit

Postby dexter » Fri Nov 05, 2010 12:57 pm

Backslash is what you use to escape characters. So it should be ^\" to anchor a quote to the beginning of the string.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

Re: filter expression for quote (") only in the first postit

Postby tgeery » Fri Nov 05, 2010 1:08 pm

dexter wrote:Backslash is what you use to escape characters. So it should be ^\" to anchor a quote to the beginning of the string.


you are, of course, correct! I typed "/" when I had actually used "\" in the filter. thanks for that correction.
User avatar
tgeery
Seasoned User
Seasoned User
 
Posts: 261
Joined: Thu Jul 07, 2005 8:25 am
Location: Northern VA, USA

Registered Newsbin User since: 07/12/05


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests