mastercheef Posted December 27, 2011 Report Share Posted December 27, 2011 hi, i tested a "or query" in ketarin but actually it dosn't work. is it even possible to make a or query? code (RegEx): (?<=<div id="download_urls_wrapper">.{0,10000}{whatprogramm} (<span class="beta-version has-tooltip" title="Vorabversion zu Testzwecken!">|)).{0,10}(?=( <img src="|</span></strong><br />).{0,3000}{target}) 1: <div id="download_urls_wrapper"> 2: the next 10000 symbols search for the ProgrammName (searched in an other varible bevore) 3: or query => either after the programm name it comes the string "<span class="beta-version has-tooltip" title="Vorabversion zu Testzwecken!">" or just nothing. (<span class="beta-version has-tooltip" title="Vorabversion zu Testzwecken!">|) 4: after the or query find the string .{0,10}(?=( <img src="|</span></strong><br />) finaly the needed string will be found but the or query will be marked red in the result, My result should be averion number like: 1.1 RC1 but in the actual result contains the string from the or query. => see at the picture is there any solution for a working or query? edit: that what you see in the screenshot (the mared red and blue text) ist this what the regex actually find. in the variable includes at the and only the red marked text, but i need the blue one! i need some helpt cause i dont know how i can solve the problem... thanks Link to comment Share on other sites More sharing options...
floele Posted December 28, 2011 Report Share Posted December 28, 2011 Blue + Red is the whole match, while Red is the match of the first group of the regex. You should make the blue part a separate group in your regex, and then provide the group number as additional argument to the "regex" function to select which value to use. Link to comment Share on other sites More sharing options...
mastercheef Posted December 28, 2011 Author Report Share Posted December 28, 2011 the result of the regex should be one string. its only based on positive and lookbehind and a positive lookahead, and the string between the lookbehind and the lookahead shoud be the match. Blue + Red is the whole match but at the end the defined variable contains only the red mared text. and the blue text (1.0 RC2) is missing. when i make a right click at the blue text and select "copy match" only the red text will be copied. i think something is wrong here. either the or query in the regex is not correct or ther is an bug in the programm. could anybody the such an example? i actually have no idea why i can solve this probleme cause i'm a beginner at the RegEx area. Link to comment Share on other sites More sharing options...
shawn Posted December 29, 2011 Report Share Posted December 29, 2011 Cheef, what Flo said is that it *is* matching the entire group as expected, but Ketarin automatically selects the first submatch when available or the entire group when no submatch is present. I understand that you're not very experienced with RegEx, and this implementation is probably just adding to that frustration - and that's probably why this is so confusing to you. However, there is an internal function specific to this requirement ("regex"), which you can use as a variable assignment or within a text block. Alternatively, if you share your full app profile, we'll be able to look at it with the necessary context to provide additional assistance. Without that we would really just be guessing at what is happening. Link to comment Share on other sites More sharing options...
mastercheef Posted January 2, 2012 Author Report Share Posted January 2, 2012 i solved it now. i splitted the two variables and modified the RegEx. thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now