I have no idea. Images may count as one "character" position, but I'm not sure. You could experiment on that basis, and just subtract from the start point of each match the cumulative length of all previous matches, and see if that works. I basically had to mess with numbers and offsets (and do manual counting of characters to see how things moved) to get it right for my robot.
I think that one of the things that would be most helpful - especially for me, as an amateur, but probably for everyone - is more clarity on what kind of content is being seen. I know that we only want to work through the interfaces provided - and that Wave is changing under the hood all the time - but some more information on document structure, annotation capabilities, available markup, etc. would be a great resource. On Oct 15, 3:56 am, Chris Searle <[email protected]> wrote: > On Oct 14, 4:46 pm, "Chris C." <[email protected]> wrote: > > > I was going to suggest an offset variable, but as you say, it appears > > that the subsequent regex search is on the just-updated text. I'm not > > sure what the issue is (I have a dice rolling bot that uses regex and > > inserts results after the relevant dice expression, and I use an > > offset variable to adjust the insertion points by an amount equal to > > the length of what was inserted on the previous iteration). Perhaps > > there's a mutability issue with doc.getText()? I use Java, so I don't > > know how that works. > > I could try this - but - how much offset is an image? > > It seems a little strange to me - but - then I feel a little unclear > about the blip's document structure. What is the result of getText() > when the blip contains media for example. The same applies to knowing > what formatting you can add (want to have a nice title, the image and > a couple of links - one to the image page one to the image license - > but I don't yet know how to apply this kind of formatting > programatically). > > I could do the "get all matches in list, reverse it and then apply" - > but that seems less elegant. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en -~----------~----~----~----~------~----~------~--~---
