Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turn Off RegEx
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I am having problems finding links that look like so "WildNight(69)" as the value is pulled daily from a table. Setting the value to "Wild Night \(69\)" will not work as every run of 200 links might need many link updates.

So, is it possible to turn RegEx Off?

I found:
ObjLink.RegularExpression = False
but do not know how to use it.

Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
Set linkDesc=Description.Create
liknDesc("innertext").value=WildNight\([0-9]*\)
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thx Rajpes for that idea too. I will put that ion my bag of tricks to use in the future.

My issue is that I have all types of funny/different characters in my links. So, I found Replace.

Code:
Public Function NormalizeString (OrgStr)

            Dim TempStr
            
            TempStr = Replace(OrgStr, "\", "\\")

            TempStr = Replace(OrgStr, "/", "\/")
            
            TempStr = Replace(TempStr, "*", "\*")
            
            TempStr = Replace(TempStr, "+", "\+")

            TempStr = Replace(TempStr, "(", "\(")

            TempStr = Replace(TempStr, ")", "\)")

             TempStr = Replace(TempStr, "=", "\=")

             TempStr = Replace(TempStr, "&", "\&")

             TempStr = Replace(TempStr, "@", "\@")

             TempStr = Replace(TempStr, "#", "\#")

             TempStr = Replace(TempStr, "_", "\_")

             TempStr = Replace(TempStr, "!", "\!")
            
            NormalizeString = Replace(TempStr, "?", "\?")
            
End Function
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
I don't think \ is needed for all special characters, it is just to nullify the reg ex wildcard characters
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Ranjes

Ok, thx for the info. But for now I will keep as i will see when I run more links that have these characters in the link name.

thx ;-)

Lor
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ReGex not working for Java Items jimrazak 0 2,176 02-23-2012, 06:17 PM
Last Post: jimrazak
  regex works but how do i return the found string to a variable jove1776 2 3,423 08-24-2011, 06:17 PM
Last Post: jove1776
  QTP 9.2 RegEx issue ashv 2 3,792 02-20-2011, 12:48 PM
Last Post: ashv
  RegEx for a child objects SBsteven 1 3,391 11-17-2009, 11:20 AM
Last Post: v_selvam
  Troubles with Regex in Browser XeNoMoRpH 4 3,333 06-18-2009, 04:31 PM
Last Post: XeNoMoRpH

Forum Jump:


Users browsing this thread: 1 Guest(s)