Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get rid of with regular expressions Howdy Excel Discussion (Misc queries) 1 January 18th 10 07:42 PM
Regular expressions in VB FiluDlidu Excel Discussion (Misc queries) 4 March 21st 08 01:10 AM
Regular expressions in Excel? a Excel Programming 8 March 4th 05 05:29 AM
Regular Expressions in VBA? Rob[_23_] Excel Programming 13 February 10th 05 05:34 AM
VBA and Regular expressions Friedrich Muecke Excel Programming 3 October 3rd 03 01:46 AM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"