Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Does 4.7 system support regex ?

Former Member
0 Likes
1,246

Does 4.7 system support REGEX ? If not , then what is the alternate that we need to use in the ABAP code ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,195

ABAP supports regular expressions as of Release 7.00.

One more thing is there , if you are able to install the patches from SAP for lower versions you can use it ( BASIS team will be knowing the correct patch).

Regards,

Ben

Does 4.7 system support REGEX ? If not , then what is the alternate that we need to use in the ABAP code ?

9 REPLIES 9
Read only

GauthamV
Active Contributor
0 Likes
1,195

Regex is supported from release 7.0 only.

http://help.sap.com/abapdocu_70/en/ABENREGULAR_EXPRESSIONS.htm

Read only

Former Member
0 Likes
1,195

Is there any alternate of REGEX that can be used in 4.7 system ?

Read only

Former Member
0 Likes
1,195

Hi Nikhil,

It will depend on your requirement.Anyway there is no exact function that do the 'regex' in ABAP.

<< Moderator message - Cut and paste response from http://sample-code-abap.blogspot.com/2010/02/regular-expression-in-sap-abap.html removed and points unassigned. Plagiarism is not allowed in SCN >>

These are some of the common use.

Please go through these SCN Blogs

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/18115]

[http://sapignite.com/regex-in-abap/].

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa?QuickLink=index&overridelayout=true]

So make sure what is your play with REGEX and these things are achieved by normal ABAP coding also.

Matt,

Thanks for your valuable info.

Edited by: Rob Burbank on Feb 14, 2012 9:42 AM

Read only

Clemenss
Active Contributor
0 Likes
1,195

Hi Nikhil,

it really depends on your requirement. Before regex was introduced, SAP provided powerful spaghetti code functions for relatively simple purposes like the check of validity of an email address which can be done better using regex.

In simple cases, especially where performance is required, you are by far better off using the existing CS CP NP operators combined with (length)+offset.

I used regex intensively once in an ALV spreadsheet with tens of thousands of cells. Then I did a performance analysis, then I replaced all regex with old-fashioned code - got a performance boost.

Regards,

Clemens

Read only

matt
Active Contributor
0 Likes
1,195

Clemens - I'm not sure you're right about regex and email address validation - it's one of the notorious problems for regex. e.g. http://stackoverflow.com/questions/201323/how-to-use-a-regular-expression-to-validate-an-email-addre...

Read only

Clemenss
Active Contributor
0 Likes
1,195

Hi Matt,

yes, you are right, the example was not chosen properly.

My statement is only that regex is powerful put slow and can be replaced by 'conventional' code..

Regards,

Clemens

Read only

Former Member
0 Likes
1,196

ABAP supports regular expressions as of Release 7.00.

One more thing is there , if you are able to install the patches from SAP for lower versions you can use it ( BASIS team will be knowing the correct patch).

Regards,

Ben

Read only

matt
Active Contributor
0 Likes
1,195

There is a workaround involving invoking JavaScript from ABAP. The details are [here|http://www.web-dreamer.de/blog/2008/02/abap-using-regex-regular-expressions-in-a-pre-netweaver-release.html].

I have used this solution and confirm that it work.

Read only

Former Member
0 Likes
1,195

This message was moderated.