Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Like Operator vs Regular Expressions
I am trying to find out if there is anyway to simulate the
functionality of the Reular Expression's "*" when using the Like operator. specifically: in Regular expressions the "*" refers to Multiple Occurences, so, [\w]* mmeans any multiple occurence of a word character,Equivalent to [a-zA-Z0-9]. But with the Like operator "*" means "Any" multiple characters, which includes the whole ASCII character set. Is there a way to limit it to just MULTIPLE characters that are just alpha-numeric. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Like Operator vs Regular Expressions
HI,
you can use vbscripts regular expression function like this.. Sub DelIt() Dim re As Object, cell As Range Set re = CreateObject("VBScript.Regexp") re.Pattern = "(-[^-]*){3}$" For Each cell In Selection cell.Offset(0, 1).Value = re.Replace(cell.Value, "") Next End Sub M$ Documentation: http://msdn.microsoft.com/library/de.../en-us/script5 6/html/vsobjregexp.asp Hth, OJ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Like Operator vs Regular Expressions
Chris,
<From Excel VBA help Like Operator ? Any single character. * Zero or more characters. # Any single digit (0-9). [charlist] Any single character in charlist. [!charlist] Any single character not in charlist. </From Excel VBA help NickHK "Chris W." wrote in message ... I am trying to find out if there is anyway to simulate the functionality of the Reular Expression's "*" when using the Like operator. specifically: in Regular expressions the "*" refers to Multiple Occurences, so, [\w]* mmeans any multiple occurence of a word character,Equivalent to [a-zA-Z0-9]. But with the Like operator "*" means "Any" multiple characters, which includes the whole ASCII character set. Is there a way to limit it to just MULTIPLE characters that are just alpha-numeric. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Get rid of with regular expressions | Excel Discussion (Misc queries) | |||
Regular expressions in VB | Excel Discussion (Misc queries) | |||
Regular expressions in Excel? | Excel Programming | |||
Regular Expressions in VBA? | Excel Programming | |||
VBA and Regular expressions | Excel Programming |