@Mahesh Madhusanka Thanks for reaching out. Logic app does have expression function and you can refer to this document for more details on the support expression.
Unfortunately, as per your use case there are no expression functions that can help you. So, you need to either leverage the inline code to write your own code (JavaScript) for your requirement as below or you can offload this functionality to azure function. In cases where you don't want to use inline code, or the inline code cannot help then you can always use azure function and call azure function within logic app.
For your requirement I have defined the variable and passed the text as per your sample text and used inline JavaScript code (match) to get the desired result.
Note: ** The below is only for reference and the inline code will be changed as per what **action input/output you will be using for your inline code. Your logic app should be using Integration account as documented here.
**Designer View: **
JavaScript Code:
let myText =workflowContext.actions["Initialize_variable"].inputs.variables[0].value
return myText.match(/S[0-9]*/g);
**Output: **
Feel free to get back to me if you need any assistance.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.