• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: regular expression with group to a string including ( ) and dash

Resolved: regular expression with group to a string including ( ) and dash

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve regular expression with group to a string including ( ) and dash

Question:

I am trying to use regular expression to find number. But I never succeed. Can anyone help me with it?
The above return empty [], what I wanted is [800,850,0.2]. I am using () to capture group. do I use ( and ) to indicate ( or ) ? and use – to indicate –
Thanks for your help.

Best Answer:

You also need to accept the dot (.) for the last number, which is not included by \d (equivalent to [0-9]).
To make sure the dot is between two consecutive groups of digits, use (\d+\.\d+).

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I write CSS selector(s) that apply to table rows for all td elements on that row after a td with a certain class?

01/04/2023

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.