Jump to content

StringRegExp()


Recommended Posts

I ran "StringRegExp($string,"(\d{1,3}[.]){3}\d{1,3}[:]\d{5}",1)" on a long string with a bunch of different IPs scattered about it. I thought it would return all of the IPs of the form 000.000.000.000:00000 where the first five 000 could be 1-3 digits long, thereby capturing all of the IPs. The return is oddly a 1-index array with only "83." in it. Any help on the Regular Expression would be great!

Edited by crzftx
Link to comment
Share on other sites

Well that did help. Thanks Siao. So... is the group always the only thing that is captured? To capture the IP would I have to do something like

Global $array = StringRegExp($string,"(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}[:]\d{5})",3)
How would I go about using a group without having the group alone returned?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...