2010 Jan 27 11:56 AM
Hi Gurus.
I need to make a REGEX to find such a pattern:
<L or G>TY_<S or T_*.
How can I make a REGEX for it? If it is not clear, what i mean is first letter can be L or G, after that will be TY_, then followed by a single character S or T, followed by an underscore (_) and then anything after that is okay.
All are case insensitive.
Your help is greatly appreciated. Thanks in adv.
2010 Jan 27 7:34 PM
You can try it
link:[REGEX TOY- TESTING REGULAR EXPRESSIONS IN ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1f9cd701-0b01-0010-87b8-f86f9b7b823f]
2010 Jan 27 7:34 PM
You can try it
link:[REGEX TOY- TESTING REGULAR EXPRESSIONS IN ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1f9cd701-0b01-0010-87b8-f86f9b7b823f]
2010 Jan 28 9:55 AM
Hi Aishi Sharma,
It is little bit complex to frame a single Regular expression, However you can use the following:
You can use the below 4 Regular expressions one after the other.
1. LTY_S_
2. GTY_S_
3. LTY_T_
4. GTY_T_
You know how to use it once,the similar way use the 4 expressions one after the other and store the result in an internal table.
So you will get the solution.
Hope this helps you.
Regards,
Rama.P
2010 Jan 27 10:13 PM
To test the regex for your text.. you can use the prog DEMO_REGEX_TOY and use green tick to execute the matches,
[Regular Expressions for Information Processing|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa?quicklink=index&overridelayout=true]
2010 Jan 27 10:14 PM
Hi,
I am not sure about it, because I have not try it, but it could be like this:
[LG]TY_[ST][[:alnum:]]*Check [Syntax of Regular Expressions|http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX.htm] for further info.
Regards,
Adrian
2010 Jan 28 9:12 AM
Thanks, but i know about these documents.
But still cannot work out this simple REGEX>
What you gave did not work for me
To elaborate, I am using it to set up the Code Inspector Naming conventions, and gave this expression in the Types field.
Does not work
Any other suggestions?
Thanks in adv.
2010 Jan 28 9:36 AM
Hi,
so it is much easier than You think:-) "Types field" is a select-option with multiple selection allowed, so You can put here following 4 lines:
GTY_S*
LTY_S*
GTY_T*
LTY_T*
That's all.
Adrian
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |