Showing posts with label Regex. Show all posts
Showing posts with label Regex. Show all posts

Tuesday, September 16, 2008

Clean Up PeopleSoft Registry entries from CIs

Over the past couple of months I have made _alot_ of changes to my CIs and have had to
re-build then and re-register them etc etc... but the problem is that when I
have to update the client end, and re-register the tlb methods, I don't have a
'Clean-Up Entries' check box.

So.... To clean the registry from the last registered TLB, take the .reg file which starts:




[HKEY_CLASSES_ROOT\TypeLib\{D991A0F6-EFDC-480E-A3B7-DED9BB542536}\PeopleSoftGeneratedKey]
@="Sun Aug 31 23:45:09
2008"[HKEY_CLASSES_ROOT\TypeLib\{D991A0F6-EFDC-480E-A3B7-DED9BB542536}\1.0]
@="PeopleSoft_PeopleSoft"[HKEY_CLASSES_ROOT\TypeLib\{D991A0F6-EFDC-480E-A3B7-DED9BB542536}\1.0\0\win32]
@="c:\\ps\\8.49\\bin\\client\\winx86\\PeopleSoft_PeopleSoft.tlb"
Get your favorite text editor that has Regular expression capabilities (I use Crimson Editor, just casue it is free and does a lot of neat things).


Find: @.*
Replace with nothing

Find: \*\*.*
Replace with nothing


Turn off Regular Expression


Find: [
Replace with: [-


Copy and Paste the whole .Reg file to excel, and sort the column A-Z, to make the longest (deeper branches first) entries go to the top of each group, copy and paste it back to the reg file. Save it to a new name so you have your orignial, and then run it... the [-Branch Name] removes each entry.

Monday, September 1, 2008

Check an E-mail address with VB.NET Regex

This is a VB.NET Function to Check an e-mail address with Regex...

Function CheckValidEmail(Optional ByVal inputEmail As String = Nothing) As Boolean
If inputEmail Is Nothing Then
Return (False)
End If
Dim strRegex As String = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + "\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + ".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
Dim re As Regex = New Regex(strRegex)
If re.IsMatch(inputEmail) Then
Return (True)
Else
Return (False)
End If

End Function
Add to Google