|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 01/27/2009 at 06:02AM PST, ID: 24086905 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: |
'-----------------------------------------------------------------
'Function : reReplace
'Description : Calls a Regular Expression object to do a search/replace on a string
'Parameters : sString - This is the string to do the search/replace in
' : sPattern - String containing the regexp pattern for the search
' : sReplacement - Optional string containing what to replace with. (defaults to blank)
' : bGlobal - Optional boolean if the search should be global in the string (defaults to false)
' : bIgnoreCase - Optional boolean if the search should ignore case in the string (defaults to false)
'Result : Returns the new string
'-----------------------------------------------------------------
Public Function reReplace(sString As String, sPattern As String, Optional sReplacement As String = "", Optional bGlobal As Boolean = False, Optional bIgnoreCase As Boolean = False) As String
Dim re As New RegExp
re.Pattern = sPattern
re.Global = bGlobal
re.IgnoreCase = bIgnoreCase
reReplace = re.Replace(sString, sReplacement)
Set re = Nothing
End Function
'-----------------------------------------------------------------
'Function : reMatch
'Description : Calls a Regular Expression object to see if search exists
'Parameters : sString - This is the string to do the search/replace in
' : sPattern - String containing the regexp pattern for the search
' : bGlobal - Optional boolean if the search should be global in the string (defaults to false)
' : bIgnoreCase - Optional boolean if the search should ignore case in the string (defaults to false)
'Result : Returns True/False on if the search was found
'-----------------------------------------------------------------
Public Function reMatch(sString As String, sPattern As String, Optional bGlobal As Boolean = False, Optional bIgnoreCase As Boolean = False) As Boolean
Dim re As New RegExp
re.Pattern = sPattern
re.Global = bGlobal
re.IgnoreCase = bIgnoreCase
reMatch = re.Test(sString)
Set re = Nothing
End Function
'-----------------------------------------------------------------
'Function : reFind
'Description : Calls a Regular Expression object to extract a pattern from a string (1st occurance)
'Parameters : sString - This is the string to search in
' : sPattern - String containing the regexp pattern for the search
' : bIgnoreCase - Optional boolean if the search should ignore case in the string (defaults to false)
'Result : Returns a string containing the extracted substring
'-----------------------------------------------------------------
Public Function reFind(sString As String, sPattern As String, Optional bIgnoreCase As Boolean = False) As String
Dim re As New RegExp
Dim oMC As MatchCollection
Dim sResult As String
sResult = ""
re.Pattern = sPattern
re.Global = False
re.IgnoreCase = bIgnoreCase
Set oMC = re.Execute(sString)
If oMC.Count > 0 Then
' remove leading and trailing spaces
sResult = Trim(oMC.Item(0))
End If
Set oMC = Nothing
Set re = Nothing
reFind = sResult
End Function
|
Advertisement