Application Development 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: 

Check a part of string with regex

ekekakos
Participant
0 Kudos
250

Hello, as I am no expert in regex I want to check in the below string

UA/2023/0838.L

from 3 to 8 we have /20??/. Can anyone suggest a solution with regex?

Thanks

Elias

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos
195

I don't know why you want to use a regular expression, it's not worth, if you use POSIX it will be very slow (and even PCRE will be slower than a classic IF condition).

Anyway, just to answer your question.

../20../.*

. is a wildcard character representing any character

* is a wildcard character indicating that the previous character (or element) may occur 0 or any number.

Look at ABAP documentation, it's described exactly the same.

BaerbelWinkler
Active Contributor
195

Elias,

if you like to "play" with REGEX, the standard and well-documented program DEMO_REGEX_TOY should help.

Cheers

Bärbel