# Extracting a number from a string in system verilog

**URL:** <https://verificationacademy.com/forums/t/extracting-a-number-from-a-string-in-system-verilog/39064>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, systemverilog-Strings\
**Created:** [May 11, 2021, 7:31am UTC](https://verificationacademy.com/forums/t/extracting-a-number-from-a-string-in-system-verilog/39064 "2021-05-11T07:31:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rubendah](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/b5e925/32.png) [@rubendah](https://verificationacademy.com/forums/u/rubendah)\
**Post date:** [May 11, 2021, 4:20pm UTC](https://verificationacademy.com/forums/t/extracting-a-number-from-a-string-in-system-verilog/39064/3 "2021-05-11T16:20:28Z")

</div>

Thanks for your answer.

I think my example was too simple. In my case, I do not know the exact string but I’m sure that the pattern “packet size is XB” will be present.

---

_[View the full topic](https://verificationacademy.com/forums/t/extracting-a-number-from-a-string-in-system-verilog/39064)._
