Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default what are the regular expression special characters while searching

Search looking for numbers embedded in text, can you use [0-9]+

My address is 1235 Main Street
Your address is 34 Elm Street
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 563
Default what are the regular expression special characters while searching

This find position of first digit
Gives erroneous result is no digit present. No time now to work on it
=MIN(FIND({"1","2","3","4","5","6","7","8","9"},A1 &"123456789"))
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Howdy" wrote in message
...
Search looking for numbers embedded in text, can you use [0-9]+

My address is 1235 Main Street
Your address is 34 Elm Street


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default what are the regular expression special characters while searching

On Mon, 18 Jan 2010 05:19:02 -0800, Howdy
wrote:

Search looking for numbers embedded in text, can you use [0-9]+

My address is 1235 Main Street
Your address is 34 Elm Street


Your question is not clear.

If you want to extract the first substring of one or more consecutive digits in
a string, you could use:

=LOOKUP(2,1/MID(A1,MIN(SEARCH({1,2,3,4,5,6,7,8,9,0},A1&{"1,2,3 ,4,5,6,7,8,9,0"})),ROW(INDIRECT("1:99"))),
MID(A1,MIN(SEARCH({1,2,3,4,5,6,7,8,9,0},A1&{"1,2,3 ,4,5,6,7,8,9,0"})),ROW(INDIRECT("1:99"))))

"99" is just some value that is longer than the longest string.

This will return a #NA error if there is no number in the string.

For SEARCH worksheet function acceptable wild cards, look at HELP for that
function. It seems pretty clear to me:

=====================
You can use the wildcard characters — the question mark (?) and asterisk (*) —
in the find_text argument. A question mark matches any single character; an
asterisk matches any sequence of characters. If you want to find an actual
question mark or asterisk, type a tilde (~) before the character.
=====================

For wildcard characters in the FIND and REPLACE dialog box, see HELP for that
method (they are the same, if I recall correctly).

There is no native support in Excel for regular expressions.

If you want to use regular expressions in Excel, you will have to use VBA to
write the appropriate UDF's, or download and install Longre's free morefunc.xll
add-in. You'll have to search the Web to find a download site; and there are
some limitations as well as advantages.

If you mean something else, let us know.

--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default what are the regular expression special characters while searching

Hi,

Regular expressions is over the top for doing what you wany, try this

=LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW($1:$10000))))

Mike
--
Mike

When competing hypotheses are equal, adopt the hypothesis that introduces
the fewest assumptions while still sufficiently answering the question.
Occam''''s razor (Abbrev)


"Howdy" wrote:

Search looking for numbers embedded in text, can you use [0-9]+

My address is 1235 Main Street
Your address is 34 Elm Street

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
Searching Uppercase characters Shams Excel Discussion (Misc queries) 3 July 15th 09 02:20 PM
Can someone help me with this regular expression? [email protected] Excel Discussion (Misc queries) 3 March 10th 09 07:36 PM
Regular expression search/replace in Excel Paul Excel Discussion (Misc queries) 15 August 6th 08 04:57 PM
Excel formula needed... regular expression? danesh Excel Discussion (Misc queries) 3 August 10th 07 12:31 PM
Regular Expression sl Excel Discussion (Misc queries) 2 January 23rd 07 11:57 PM


All times are GMT +1. The time now is 09:17 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"