- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

**[Migrated content. Thread originally posted on 28 September 2011]**

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

And of course:

Imports System.Text.RegularExpressions

should be used

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

*akash originally wrote:*

Right now, * (wild card) is the only regular expression we are exposed to. Is there any list that contains all regular expression? I searched the help but no luck. Can somebody help me out in this?

SilkTest does not support regular expressions for locating objects, it does only support the wild cards '?' which matches a single character and '*' which matches any number of characters.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

*akash originally wrote:*

Any plans to introduce other regular expressions in SilkTest?

Can you describe the problem you are trying to solve? If we understand that, we can either help you find a solution using existing features or better plan the features we need to add.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

Hi guys, regarded to the use of regular expressions, I have next situation:

**Imports **System.Text.RegularExpressions

**Dim** actualValue **As String** = myObject.GetProperty("caption")**If** actualValue.Contains(**"/"**) = **True Then*** actualValue = Regex.Replace(actualValue, "*/", "")*

**Else**

**End If***actualValue =*

*actualValue.*Replace(**"*/"**,**""**)*...*

Where for e.g.: *actualValue* = 2/32546 (this string has the maximum left side's lenght/size = right number's lenght/size, so it might be also = 32546/32546, generally it is: 1->32546/32546)

So, this value can contain 1 to 7 chars as on the left side, same on the right side of the slash. Also both left and right side numbers might be different numbers in different conditions.

What I'm trying here is to replace the slash and whatever it has on the left side with nothing, in this way it should be removed and I'll get just the number from the right side of the slash.

So when I use: *actualValue = Regex.Replace(actualValue, "/", "")* --- this one works well (no regex here: *), the / is replaced with nothing and removed from the entire string, and as a result I get: 232546

But when I'm using: *actualValue = Regex.Replace(actualValue, "*/", "")* --- here, when * is added nothing happens, the string remains the same 2/32546. Tried more combinations of regular expressions and nothing works, any ideas?!

P.S.: When V 14 of Silk Test will be delivered?!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

NOTHING?!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

how about:

var leftPart = actualValue.Split('/')[1]

you know that there's a '/' and you split the string in tow parts and take the one that your're interested in.

as for the release date of Silk Test 14, i am not sure if there is an offical GA date announced yet.

kind regards,

ulrich

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

##
RE: Various Regular Expressions Available in SilkTest

solved it, see that:

Dim newActualValue As String

If actualValue.Contains("/") = True Then ''2/32069'

actualValue = Regex.Replace(actualValue, ".*/", "")

actualValue = newActualValue

Else

End If

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

And of course:

Imports System.Text.RegularExpressions

should be used