Extract a number from a string, after a certain character
<p>Ayyyy, I need some help. I have the following strings, always in "char,num" format:</p>

<pre><code>s = "abcdef,12"
v = "gbhjjj,699"
</code></pre>

<p>I want to get just the digits after the comma, how do I do that without splitting the string with the comma as a delimiter?</p>

<p>I tried <code>s[-2:]</code> and <code>v[-3:]</code> which works, but how do I make it work without knowing the number of digits?</p>

<p>Maybe you can try with a <a href="https://docs.python.org/3.5/library/re.html" rel="nofollow">regular expression</a></p>

<pre><code>import re

input_strings = ["abcdef,12", "gbhjjj,699"]

matcher = re.compile("\d+$")

for input_string in input_strings:
    is_matched = matcher.search(input_string)
    if is_matched:
        print(is_matched.group())
</code></pre>

python