-5

How do I extract all the numbers after this ">" on my regex expression.

<sbs-test-2/sba>15

15 can change like a random number.

Thank you!!!

I tried this way, but doesn't get me much!

(< tzdxtext>)(\d\d)

Aleks Andreev
  • 7,016
  • 8
  • 29
  • 37
mz3bel
  • 59
  • 1
  • 7
  • I don't get what the "15" means.. is that the result you're trying to get? What are some examples of input and expected results? – Broots Waymb May 20 '19 at 13:06
  • is this: `"15"` the entire string? or is it embeded into a longer one? up to now I don't see any real need for regex. Or are you doing this for an educational purpose? – Mong Zhu May 20 '19 at 13:09
  • how about `>(\d{2})` (exactly 2 digits) or `>(\d+)` (more than two digits). If you have other restrictions than just "after >" you need to elaborate – derpirscher May 20 '19 at 13:10
  • It looks like you can try `>\d+$` expression – Aleks Andreev May 20 '19 at 13:11
  • @AleksAndreev To get the digits for further use, you should use a capturing group – derpirscher May 20 '19 at 13:13

1 Answers1

2

Thank you all for your quick response!!!!

15 is the result i'm looking for. (15 is just an example, but it's only numbers)

"<sbs-test-2/sba>15" this the entire string.

@Aleks Andreev, thank you! >\d+$ works!!!

@derpirscher, @Mong Zhu and @Broots Waymb Thank you! problem solved!

mz3bel
  • 59
  • 1
  • 7