cancel
Showing results for 
Search instead for 
Did you mean: 

RegEX matching type in the application modeller

MarwaSedik1
Level 2
Hi there, 
While spying on SAP element with the following Id attribute

/app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB1:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1102/tabsHEADER_DETAIL/tabpTABHDT3

the highlighted  "3" with red is changeable based on the different window layouts (changing between 3 , 6 or 5) so I was trying to use Reg Ex to solve this issue but it didn't work with me with using the following expression

\/app\/con\[0\]\/ses\[0\]\/wnd\[0\]\/usr\/subSUB0:SAPLMEGUI:001/d\/subSUB1:SAPLMEVIEWS:1100\/subSUB2:SAPLMEVIEWS:1200\/subSUB1:SAPLMEGUI:1102\/tabsHEADER_DETAIL\/tabpTABHDT3

I replaced 3 by \d 
and put \ before any special character like /  or [  or ] 

so what should I do ?

4 REPLIES 4

AvinashRamkumar
Level 4

Hi Marwa,

I believe you can separate the components using () and [] in regex and use [0-9] for a single digit number instead.

Please try using this instead and confirm if this works:

^(\/app\/con\[0\]\/ses\[0\]\/wnd\[0\]\/usr\/subSUB0:SAPLMEGUI:001)[0-9](\/subSUB1:SAPLMEVIEWS:1100\/subSUB2:SAPLMEVIEWS:1200\/subSUB1:SAPLMEGUI:1102\/tabsHEADER_DETAIL\/tabpTABHDT3)$



Another alternate method would be to store the below value to a data item and change the number as per screen/logic. Would need to set the Attribute ID as type Dynamic.

/app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB1:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1102/tabsHEADER_DETAIL/tabpTABHDT3


Please let me know if this answer was helpful. 
Thanks

MarwaSedik1
Level 2
@Avinash Ramkumar
Hi Avinash,
thanks a lot for your answer, I tried your solution but unfortunately it didn't work also.
and the second solution to make it dynamic isn't applicable for me, because layout conditions are too many.​

AvinashRamkumar
Level 4

Hi Marwa,

Could you please share a screenshot of your app modeller with ​Element and regex value. (Eg below)

36218.png

Thanks
Avinash

EVIPUTI
MVP
You have used wrong slash in your regex code . You should use \d but i see above you have used /d . Can you confirm please ?
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------