Jump to content
Sign in to follow this  
OmYcroN

StringRegExp - non-matching groups

Recommended Posts

OmYcroN

How can I use a non-matching group in this case:

Local $categoryNodes = StringRegExp($categoriesNode[0], '<category name="I DON'T NEED">(.*?)</category>', 3)

What should I DON'T NEED (has diferent values) be ? I catch what I need in (.*?).

Edited by OmYcroN

Share this post


Link to post
Share on other sites
jdelaney

why not just use $categoriesNode[0].text or $categoriesNode[0].innertext

are these dom objects, or just arrays you created?

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
OmYcroN

Example:

<category name="catone">textone</category>

<category name="cattwo">texttwo</category>

...

<category name="catn">textn</category>

I want to return only textone, texttwo, ..., textn

(?: ... ) Non-capturing group. Behaves just like a normal group, but does not record the matching characters in the array nor can the matched text be used for back-referencing.

How can I use that ? Please give an example. Thank you.

Share this post


Link to post
Share on other sites
OmYcroN

This is what I found out and works:

<category name="(?:.*?)">(.*?)</category>. Topic can be closed now.

Edited by OmYcroN

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.