Regex first and last characters must be a number -


could please me come correct regex match string starts , ends digit. string between these 2 digits may have , , . , digits only.

i have tried:

([0-9.,]+) 

strings match:

,5,190 ,5,190, 

output should 5,190.

alright let's take definition bit bit:

  • string starting number.

    [0-9] or \d same thing.

  • string may have , , . , consist numbers.

    `[\d,.]*

  • string ends number.

    \d

which gives \d[\d,.]*\d. try it, , please try understand before moving on.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -