I'm having some trouble trying to develop a regular expression which will pick out all the function calls to "tr" from this block of asp code below. Specifically I need to get the string in each "tr" function call.
if(RS.Fields("Audid").Value <> 0 ) Then
Response.Write ("<td>" & tr("RA Assigned") & "</td>")
else
Response.Write ("<td>" & tr("Not Yet Assigned") & "</td>")
End if
if(RS.Fields("rStatus").Value = "Activated") then
Response.Write("<td><A HRef='portal_setup_billingII.asp?OrderPId=" & RS.Fields("CustomerParid").Value & "&OrderId=" & RS.Fields("OrderId").Value & "'>" & tr("Edit") &"</A></td></TR>")
Else
If (gParLevelz_Admin = gParLevelz and RS.Fields("CustomerParid").Value <> 0) Then
Response.Write("<td><A HRef='portal_setup_billingII.asp?OrderPId=" & RS.Fields("CustomerParid").Value & "&OrderId=" & RS.Fields("OrderId").Value & "'>" & tr("Awaiting Authorization") & "</A></td></TR>")
else
Response.Write("<td>" & tr("Awaiting Authorization") & "</td></TR>")
End if
End if
I believe I have a good first attempt at getting this done. The following expression extracts values for most of the cases I will run into...
tr\(\"([^%]|%[0-9]+)+\"\)
What's causing me the most confusion and stress is how to capture all manner of strings which show up in the "tr" function. Literally anything could be between the quotation marks of the "tr" call and unfortunately my expression returns values past that last quotation. So given the above snippet which I have posted one of the matches is...
tr("RA Assigned %2") & "</td>")
else
Response.Write ("<td>" & tr("Not Yet Assigned %4") & "</td>")
End if
if(RS.Fields("rStatus").Value = "Activated") then
Response.Write("<td><A HRef='portal_setup_billingII.asp?OrderPId=" & RS.Fields("CustomerParid").Value & "&OrderId=" & RS.Fields("OrderId").Value & "'>" & tr("Edit") &"</A></td></TR>")
Else
If (gParLevelz_Admin = gParLevelz and RS.Fields("CustomerParid").Value <> 0) Then
Response.Write("<td><A HRef='portal_setup_billingII.asp?OrderPId=" & RS.Fields("CustomerParid").Value & "&OrderId=" & RS.Fields("OrderId").Value & "'>" & tr("Awaiting Authorization") & "</A></td></TR>")
else
Response.Write("<td>" & tr("Awaiting Authorization") & "</td></TR>")
Which is way more than I want. I just want tr("RA Assigned %2")
to be returned.