J
Jon Maz
Hi All,
Am getting frustrated trying to port the following (pretty simple) function
to CSharp. The problem is that I'm lousy at Regular Expressions....
//from http://support.microsoft.com/default.aspx?scid=kb;EN-US;246800
function fxnParseIt()
{
var sInputString = 'asp and database';
sText = sInputString;
sText = sText.replace(/"/g,"");
if (sText.search(/(formsof|near|isabout)/i) == -1)
{
sText = sText.replace(/ (and not|and) /gi,'" $1 "');
sText = sText.replace(/ (or not|or) /gi,'" $1 "');
sText = '"' + sText + '"';
}
sInputString = sText;
}
If anyone can give me a hand, it would be much appreciated!
TIA,
JON
Am getting frustrated trying to port the following (pretty simple) function
to CSharp. The problem is that I'm lousy at Regular Expressions....
//from http://support.microsoft.com/default.aspx?scid=kb;EN-US;246800
function fxnParseIt()
{
var sInputString = 'asp and database';
sText = sInputString;
sText = sText.replace(/"/g,"");
if (sText.search(/(formsof|near|isabout)/i) == -1)
{
sText = sText.replace(/ (and not|and) /gi,'" $1 "');
sText = sText.replace(/ (or not|or) /gi,'" $1 "');
sText = '"' + sText + '"';
}
sInputString = sText;
}
If anyone can give me a hand, it would be much appreciated!
TIA,
JON