Hello All,
Is there a way to search a string for pattern like hh:mm:ss AM or PM and then extract it if it exists.
Tahnk you. :confused:
Printable View
Hello All,
Is there a way to search a string for pattern like hh:mm:ss AM or PM and then extract it if it exists.
Tahnk you. :confused:
I would start with finding the beginning of what you are looking for;
dim index as integer
index = string.LastIndexOf(searchstring)
Then copy what you want into another string;
newstring = searchstring.substring(index, len(searchstring))
This would do it, but it's very general, just read the string manipulation help files, then go through the string you're searching bit by bit and copy what you need.
Read up on regular expressions (System.Text.RegularExpressions).
I’m trying to math this pattern 12:00:00 AM
Can some one tell me what I’m doing wrongCode:“\A(\d(1[0-2][0-9])): (\d(2[0-5][0-9])): (\d(3[0-5][0-9]))\s AM|PM \Z”
:confused:
Check out the Like function. Great for pattern matching too.
HTH
Hume