View Single Post
  #25   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Regular Expression Help on syntax

On Sun, 10 Jan 2010 07:15:53 +0000, Walter Briscoe
wrote:

For my part, I would start with "-?\d+" to grab a whole number. i.e a
whole number is a minus which is optional followed by a digit one or
more times. I found the OP's situation too complicated to want to follow
and offer a suggestion.


I agree with a lot of what you wrote.

I would point out that the above construct will also extract whole numbers that
are embedded within other strings. That may or may not be desirable.

In other words, it can extract both integers from the string below:

abc123abc 123
--ron