Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Get digits + periods from a string?

Asked by
dad9 0
9 years ago

I'm trying to get digits + periods from a string and I can't seem to find the right way to do it.

Here's my current code:

example = "blahblah at 25.132.69.69"
print( example:match("%d+%p+") )

Anyone care to help?

1 answer

Log in to vote
0
Answered by 9 years ago

Perhaps your capture should look more like [%d.]+ which will allow it to capture a sequence of digits and stops

Ad

Answer this question