regex expression for finding alphanumeric text

vb.net 2003

I have Alphanumeric numbers in a string.
example:

APPLETON APPPB100D BUSHING 1" INSULATED
APPLETON APPPB150D BUSHING 1-1/2" INSULATED

I need a regex expression to examine the string...

If it sees a string starting with "APP"...STRIP THE "APP"  and return the rest of the string.
But the string must be an alphanumeric string...

so the result would be:
APPLETON PB100D BUSHING 1" INSULATED
APPLETON PB150D BUSHING 1-1/2" INSULATED

temp = Regex.Replace(temp, "\sAPP([0-9A-Z])", " $1")   <----- JUST GUESSING ...NOT WORKING ?

ITS DOING THIS: !
  LETON PB150D BUSHING 1-1/2" INSULATED

thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?
 
ozoCommented:
temp = Regex.Replace(temp, "\sAPP([A-Z]*[0-9])", " $1")  
0
 
CodeCruiserCommented:
>ITS DOING THIS: !
>  LETON PB150D BUSHING 1-1/2" INSULATED

Is it not what you want? Or is it the space at the start which is the problem?
What happens when you use
temp = Regex.Replace(temp, "\sAPP([0-9A-Z])", "$1")
Or
temp = Regex.Replace(temp, "\sAPP([0-9A-Z])", "")
0
 
FordraidersAuthor Commented:
its cutting off the "APP" in the word..."APPLETON" in the string.
its needs to stay the same..


0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
CodeCruiserCommented:
>If it sees a string starting with "APP"...STRIP THE "APP"  and return the rest of the string.
I thought that's what your requirement is. You seem to be contradictory. Please explain in more details.
0
 
FordraidersAuthor Commented:
my original request:
"If it sees a string starting with "APP"...STRIP THE "APP"  and return the rest of the string.
But the string must be an alphanumeric string..."  <-----
0
 
CodeCruiserCommented:
Still do not understand. "LETON PB150D BUSHING 1-1/2" INSULATED" is an alphanumeric string.
0
 
CodeCruiserCommented:
What do you want to be returned from APPLETON PB150D BUSHING 1-1/2" INSULATED?
0
 
FordraidersAuthor Commented:
sorry I'm talking about the tokens inside the string itself ...

APPLETON <----  does not qualify  only alpha token.

APPPB150D <----   ALPHANUMERIC TOKEN...

sorry for the confusion...
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.