Need simple regex

I need a regular expression that basically stops when it encounters a numeric in the string.
For Example:

String: CB RICHARD ELLIS 12/06
RegEx should return: CB RICHARD ELLIS

String: Maritime Telecoms 2ND Lien 5/06
RegEx should return: Maritime Telecoms
SLoBoilAsked:
Who is Participating?
 
ddrudikCommented:
Sorry, leave out the ^:

Reference: [ a-zA-Z.,:-]*
0
 
ddrudikCommented:
match on ^\D*
trim the ending whitespace that is returned if desired.
0
 
ahoffmannCommented:
^(\D*)
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
SLoBoilAuthor Commented:
Neither of those work :(
0
 
ozoCommented:
How did you use them?
0
 
ahoffmannCommented:
which regex flavour are you using, please post your example also
0
 
SLoBoilAuthor Commented:
I'm actually using an optical scanning tool called Quick Fields. It is part of the Laserfiche product.

Basically I am scanning a tif image that has a text line like either of the following:

Sample1:
   Reference: MARITIME TELECOMMS 2ND LIEN 5/06

Sample2:
  Reference: CB RICHARD ELLIS 12/06

For Sample1 I need a regEx that returns just  MARITIME TELECOMMS

For Sample2  I need a regEx that returns just  CB RICHARD ELLIS

I current have this:
  (Reference[:,]\b+{(\a+\b?)*}[$1234567890+(]?)
and it returns CB RICHARD ELLIS 12

so i am close.
0
 
ddrudikCommented:
the following would return Reference: and any non-numerics.
Reference: [^0-9]*

Open in new window

0
 
ddrudikCommented:
Where in QuickFields are you using this regular expression?
0
 
SLoBoilAuthor Commented:
Thanks  ddrudik, the following is very close  
        Reference: [^0-9]*

Is there something I could add to it that would also ignore special characters (windows characters that is)

0
 
ddrudikCommented:
You could just define the set of characters you want to allow and include them in the [^...] block in the pattern such as:
[^a-zA-Z0-9.,:-]
0
 
ddrudikCommented:
If you want to allow spaces as well:
[^ a-zA-Z0-9.,:-]
0
 
SLoBoilAuthor Commented:
Doesn't the  ^   say not any of those characters ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.