Jump to content

StringRegExp Array question


Recommended Posts

What I am trying to do is place the results of a StringRegExp into an existing array but from I see, I have to have a temp array to hold the results then inject those results into my array (See below)

Is there an easier way?

$Resource_Levels[$loop][0] = $oLink.Title

$array = StringRegExp($oLink.Title, '[0-9]{1,3}', 1)

$Resource_Levels[$loop][1] = $array[0]

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

Is there a better way to script this? I am having to setup a temp array to store the results just to pass those results into another array.

$Resource_Levels[$loop][0] = $oLink.Title

$array = StringRegExp($oLink.Title, '[0-9]{1,3}', 1)

$Resource_Levels[$loop][1] = $array[0]

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Moderators

Is there a better way to script this? I am having to setup a temp array to store the results just to pass those results into another array.

I don't understand what the issue is with the temp array, it's not really a temp, it's the array returned from the function itself.

Try this (no idea if it will work)

$Resource_Levels[$loop][0] = $oLink.Title
$Resource_Levels[$loop][1] = StringRegExpReplace($oLink.Title, "(.*?)(\d{1,3})(.*?\z)", "\2")

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Crud ;) Uh well...

Thanks for the info

Yep, I'm afraid a temp array is the only way.

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Moderators

I responded to one of the two questions you posted on the same exact thing, and merged the two. Please don't make duplicate posts (and yes, they had different titles, but as you can see the same exact questions).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Sorry, my wireless dropped and I didn't see the 1st post afterwards.

I responded to one of the two questions you posted on the same exact thing, and merged the two. Please don't make duplicate posts (and yes, they had different titles, but as you can see the same exact questions).

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Moderators

Sorry, my wireless dropped and I didn't see the 1st post afterwards.

NP, just be a bit more conscious when using your wifi and posting ;) ...

Generally speaking, as soon as you hit submit, it may look like you didn't post, but it did (Happens to me, and I just wait until I get connection to the forum again to see if it posted first).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...