I’m doing this in Javascript
Here’s my string: 09.22.2011-23.21-west-day
Here’s what I’d like to pull out of it: 23.21
Here’s my expression: /-[0-9]*\.[0-9]*/
I get -23.21 so I’d have to run a a replace method after this to remove the “-“. Is there a way to leave out the “-” with this regex or not? I never really perfected my regex skills because I usually use PHP which has the nice () capture groups.
Javascript has capture groups too:
Gives you
23.21\das a shorthand for[0-9]{n}or{m,n}quantifiers. It will reduce the chance of it matching the wrong thing.