cancel
Showing results for 
Search instead for 
Did you mean: 

Need a regular expression not to select a particular word

Highlighted
Contributor

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)
2 REPLIES 2
Highlighted

RE: Need a regular expression not to select a particular word

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

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Community Hero

RE: Need a regular expression not to select a particular word

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...



.*"(?<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
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors