Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disallowing Strings in Regex..

Status
Not open for further replies.

webmigit

Programmer
Aug 3, 2001
2,027
US
In Regex, if you want to disallow... say... any numbers you would use this:

#Replace(String,"[^0-9]","","ALL")#

But what if say, you wanted disallow 12, but allow 1 and 2?

For instance... 182 would pass, 1 would pass, but 12 would not pass..

Any ideas?

Thanks,
Tony Did I help?
Vote!
 
Doesn't #Replace(String,"12","","ALL")# work?

Stephen G
 
Yes but no,

Here's what I'm doing.. I'm basically replacing:

Code:
[quote]*[/quote]

with

Code:
<blockquote>{value of *}</blockquote>

But the problem is that it works fine except if there's more than one set of quotes like:

Code:
[quote]*1[/quote][quote]*2[/quote]
and here's what comes out:

Code:
<blockquote>{value of *1[/quote][quote]value of *2}</blockquote>
..

Thanks,
Tony Did I help?
Vote!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top