Sign in to follow this  
Followers 0
OmYcroN

StringRegExp - non-matching groups

4 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

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

#4 ·  Posted (edited)

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  
Followers 0