Hello,
I am using the Regex_Search Server Action with the pattern "BGA\D*(\d+)".
It returns the matched string correctly, but I want only the "captured group" i.e. only the number, without the string containing "BGA" before it.
Is it possible?
Many thanks
Alain
Hi @Alain Cuvillier ,
you could switch to the RegexMatch action of this forge component, it will give back a group of results, the whole matched string and also each capturing group you defined.
Dorine
There are couple of methods you can use to get that string and most simple one is you can use string replace method() and search your string which you want to replace & replace it with empty "" string and you will get the number as output.
there are other options are well
https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/built_in_functions/text/#Replace
It totally depend upon your string format which one works best for you.
Regards,
Manish Jawla
Hi Manish ,
my strings are like this:
TFBGA 292
TFBGA-290
BGA_200
I don't know what to expect between the "BGA" part and the number.
I don't see how to use the Replace() or the String_Split.
Or I am missing something?
As I said it always depend upon your string format. I have created a sample app for you. please check that.
If you always looking for 3 digit numbers in the end of your string you can easily get it by using substr() method. Please check the attached oap.
Thanks,