.net - Regex to exclude string at beginning of string -


i want exclude fixed string @ beginning, numbers after fixed string.

the fixed string re163, here examples expected result:

example     result re16310000  10000 re16312345  12345 re16316300  16300  

i've tried following regex:

it works these examples:

re16310000  10000 re16319999  19999 

but doesn't fit that:

re16320000  320000    (expected 20000) re16316320  320       (expected 16320) 

why regex? substring enough:

string source = "re16310000";  string result = source.substring(5); 

in case have use regular expressions can try

(?<=re163)[0-9]+$ 

pattern; c# example:

string pattern = @"(?<=re163)[0-9]+$";  string result = regex.match(source, pattern).value; 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -