![]() |
|
|
|
#1 |
|
oops, mesage sent too soon,
so if you have a pattern that must not start with an A but can then have many characters use "[^A].+" not "this" seems to be rarher clumsily "[^t][^h][^i][^s].+" perhaps there is a better way Colin "Colin Mackenzie" <> wrote in message news:bdpnoj$heg$... > the reg ex for not is the ^ (shift 6 on my PC) charcater > "Red Ogden" <> wrote in message > news: om... > > Please can anyone tell me the regex for Not > > E.g. I don't want the string to begin with 'this'?? > > Thanks in advance > > Redge. > > Colin Mackenzie |
|
|
|
|
#2 |
|
Posts: n/a
|
Many thanks again Colin - as you can no doubt gather I am new to reg
expressions - I see what you mean about being clumsy - is it necessary to give a range for each letter? And would that mean that the string could not start with 't'? Thanks Redge. "Colin Mackenzie" <> wrote in message news:<bdpo4j$qtq$>... > oops, mesage sent too soon, > > so if you have a pattern that must not start with an A but can then have > many characters use > > "[^A].+" > > not "this" seems to be rarher clumsily > > "[^t][^h][^i][^s].+" > > perhaps there is a better way > > Colin > > "Colin Mackenzie" <> wrote in message > news:bdpnoj$heg$... > > the reg ex for not is the ^ (shift 6 on my PC) charcater > > "Red Ogden" <> wrote in message > > news: om... > > > Please can anyone tell me the regex for Not > > > E.g. I don't want the string to begin with 'this'?? > > > Thanks in advance > > > Redge. > > > > |
|
|
|
#3 |
|
Posts: n/a
|
yes, it was clumsy and you are correct in saying that it would not alow
"that" (because of the not "t"). I was stuck so I put a question into the schema dev newsgroup. The basic answer is that whole strings cannot be negated in the current version of schema. Jeni Tennision however did come-up with the following work around however (Jenni's comments below). I simplified the string to negate to be "STR". I think you can use: (([^S].*)|(S[^T].*)|(ST[^R].*)) in other words, the string can start with something that isn't S; or it can start with S, as long as it's followed by something that isn't T; or it can start with ST, as long as it's followed by something that isn't R. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ "Red Ogden" <> wrote in message news: om... > Many thanks again Colin - as you can no doubt gather I am new to reg > expressions - I see what you mean about being clumsy - is it necessary > to give a range for each letter? And would that mean that the string > could not start with 't'? > > Thanks > Redge. > > "Colin Mackenzie" <> wrote in message news:<bdpo4j$qtq$>... > > oops, mesage sent too soon, > > > > so if you have a pattern that must not start with an A but can then have > > many characters use > > > > "[^A].+" > > > > not "this" seems to be rarher clumsily > > > > "[^t][^h][^i][^s].+" > > > > perhaps there is a better way > > > > Colin > > > > "Colin Mackenzie" <> wrote in message > > news:bdpnoj$heg$... > > > the reg ex for not is the ^ (shift 6 on my PC) charcater > > > "Red Ogden" <> wrote in message > > > news: om... > > > > Please can anyone tell me the regex for Not > > > > E.g. I don't want the string to begin with 'this'?? > > > > Thanks in advance > > > > Redge. > > > > > > |
|
|
|
#4 |
|
Posts: n/a
|
Colin
Many thanks for the further explanation and for Jenni's workaround. All the best Redge. |
|