Need a regular expression not to select a particular word
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2010
07:04 PM
03-25-2010
07:04 PM
Need a regular expression not to select a particular word
Hi
I want a regular expression not to select a particular word
Ex: I have a string "This is very great"
now i dont want to select "very" from the that string.For that i want a regular expression
I am using TestComplete version 7.51 (VB Script)
I want a regular expression not to select a particular word
Ex: I have a string "This is very great"
now i dont want to select "very" from the that string.For that i want a regular expression
I am using TestComplete version 7.51 (VB Script)
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2010
08:33 PM
03-25-2010
08:33 PM
Hi siddhardha,
First of all, please note that we provide support for AutomatedQA products, not for Microsoft regular expressions syntax used in VBScript and JScript. However, here is what you can try: take the entire string and just remove the problematic word from it. You can use the native Replace method to do this. Please see the following MSDN Library article for more information:
http://msdn.microsoft.com/en-us/library/k9z80300(VS.85).aspx
Also, you can find more information on regular expressions here:
http://autonomicon.blogspot.com/
Best regards,
Alexey
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2010
11:37 PM
03-25-2010
11:37 PM
Something else that you can do.
My developer here made up a little .NET assembly that put some wrappers around the .NET regular expressions object that allows my to use groupings. With that object, the following regular expression can give me back values based upon the groupings I put in the expressions...
With that RegEx, I can reference the column, row, value, and stored groupings of the expression individually
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
My developer here made up a little .NET assembly that put some wrappers around the .NET regular expressions object that allows my to use groupings. With that object, the following regular expression can give me back values based upon the groupings I put in the expressions...
.*"(?<column>.*)".* row (?<row>\d*) contains .*\((?<value>.*)\) that differs from .* \((?<stored>.*)\).
With that RegEx, I can reference the column, row, value, and stored groupings of the expression individually
GlobalRegEx.TestCompleteUtils.GetGroupValue(GlobalRegEx.CurrentMatch, 'row').OleValue;
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
