Robert Valentino Well-Known Member Licensed User Longtime User May 15, 2016 #1 I need to replace any form of " bk### " with " ### " bk can be lower case or upper case ### is a number 1 to 3 digits Examples: " bk123 " would become " 123 " NOW there is a lot of other text and numbers in this string. But I need an easy way to convert this particular case and everything becomes easy. Is there a Regex expression that would do this for me? Thanks BobVal
I need to replace any form of " bk### " with " ### " bk can be lower case or upper case ### is a number 1 to 3 digits Examples: " bk123 " would become " 123 " NOW there is a lot of other text and numbers in this string. But I need an easy way to convert this particular case and everything becomes easy. Is there a Regex expression that would do this for me? Thanks BobVal
somed3v3loper Well-Known Member Licensed User Longtime User May 16, 2016 #2 I am not familiar with Regex but searching a bit I came up with this Code: Copy Sub find_expression(text As String) Dim matchr As Matcher=Regex.Matcher("\bbk[0-9]{1,3}\b",text ) Do While matchr.Find Dim result As String =matchr.Match Log(result.SubString(2)) Loop End Sub Upvote 0
I am not familiar with Regex but searching a bit I came up with this Code: Copy Sub find_expression(text As String) Dim matchr As Matcher=Regex.Matcher("\bbk[0-9]{1,3}\b",text ) Do While matchr.Find Dim result As String =matchr.Match Log(result.SubString(2)) Loop End Sub
LucaMs Expert Licensed User Longtime User May 16, 2016 #3 somed3v3loper said: but searching a bit Click to expand... Upvote 0
somed3v3loper Well-Known Member Licensed User Longtime User May 16, 2016 #4 Did I make mistake ? Upvote 0
LucaMs Expert Licensed User Longtime User May 16, 2016 #5 somed3v3loper said: Did I make mistake ? Click to expand... No Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User May 16, 2016 #6 Works just find. Thanks so much Upvote 0