Jump to content

Recommended Posts


im using this statement to get a specific content between two tags:


It works fine. But now i have to add a functionality, because it can happen, that after "<resource" another tags comes up, but the regex should ignore it

the content can be like this

<resource mytag="xy">xy:/resources/xyz/123</resource>

what do i have to change to my rule, that is has something like

StringRegExp($content,'<resource I_DONT_CARE_WHAT_STANDS_HERE>xyz:/resources/([^<]*)<\/resource>',3)

any ideas?

Share this post

Link to post
Share on other sites

just a stab:


Post a runnable test script when you want it confirmed as I am way too lazy to have to type that myself. ;) 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

You might try to do it backwards  :)

#Include <Array.au3>

$content = '<resource>xy:/resources/xyz/123</resource>' & @crlf & _ 
        '<resource mytag="xy">xy:/resources/xyz/456</resource>'

$res = StringRegExp($content,'([^/]+)</resource>', 3)
; or this, depending of the expected result
; $res = StringRegExp($content,'([^/]+/[^/]+)</resource>', 3)



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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...