Extracting text from a string

Question: Hi,

I have the following string:
Sales order created for Division (D3). Contact Delta.

I want to extract anything between the bracket(in this case):
D3

Since (D3) can be anywhere in the string, I tried to use 'Search' but I can only search for '('. Is there a better way to extract between the bracket?

Thanks in advance guys.
B.

Answer:
When you search you'll get a position. Search for the closing bracket, and you'll get another position.

Take the data between the two positions...
_________________
The Doc
Magna Grand Docot of the Tuly Idiot Order

2007 Basic Rules

Answer:
With the very latest versions of SAP, you'll be able to do this using Regular Expressions. So something like:

FIND REGEX '\(.*)\' IN 'this (str)ing' MATCH OFFSET off MATCH LENGTH len.

Will give you off = 5, len = 5.

Apparently matching balanced brackets isn't possible in regex, so you'll have so strip those off yourself.

Otherwise, implement regex as shown in this thread https://www.sdn.sap.com/irj/sdn/thread?threadID=62601

Cheers

m@t
_________________
TULY The quality of answers is roughly proportional to the quality of the question.

The downside of being better than everyone else is that people tend to assume you're pretentious.

Answer:
Technically same as above suggestions, but with a different syntax:
split string at '(' into dummy1 dummy2.
split dummy2 at ')' into spart  dummy2.
* spart is what you want..

Answer:
Thanks guys. appreciated.
Copyright ?2007 - 2008 www.jt77.com