Answers for "regex just numbers"

3

just number regex

// https://regex101.com/r/qyq3PG/1
// or 
/^[0-9]*$/
Posted by: Guest on July-11-2020
3

regex 10 numbers only

@"^\d{10}$"
Posted by: Guest on May-10-2021
1

regex for numbers

Regex regex = new Regex(@"^\d$");
Posted by: Guest on November-14-2020
0

tpl regex any numbers

{$your_string|regex_replace:"/[0-9]/":"text you want to replace with"}

PAY ATTENTION
Ex: the string is: 'test.com/foo123-test/' and you use:
{$your_string|regex_replace:"/[0-9]/":"bar"}

The result will be 'test.com/foobarbarbar-test/'
beacuse it match three times the regex rule

If you want to replace the full '123' part you can add another char to makes the match unique, like:
{$your_string|regex_replace:"/[0-9]+-/":"bar"}
        this is needed to ADD char-^^-this is the added char
Posted by: Guest on October-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language