I see I put off learning about regular expressions too long, since now I desperately need to write one for a big bulk of stuff and am starting from scratch. I read textpad's help and I read a couple of websites with sort of tutorials. It does seem pretty straightforward albeit complex with all the options and little-logical catches easy to miss. But when I came up with something I thought would work, if I try to use it in textpad search (with or without POSIX spec'd), as regular expression checked, it just tells me it can't find it-- as if, perhaps, it's looking for the literal characters of my regex. Or, I just completely sucked at choosing a regex I suppose.
I searched this forum and read several threads but didn't get an answer (though I learned some other things!).
The content I am trying to deal with follows. This is the 'literal' content. The 'escaped tags' and 'See ' at the front are always the same, but everything in the middle varies (the value:pair values).
Code: Select all
See <clebook id="rec"><ebook-link eISBN="9780538475327" contextualized="true" chapterName="Effective and Ethical Communication at Work" sectionName="Communication Skills and You">pages 4-5.</ebook-link></clebook>
I figured I should do a S&R on the whole product first to get rid of all the escaped HTML in the middle of the XML. Of course this is a problem since it might un-escape stuff that needs escaping (I am a bit new to what I'm dealing with here so I'm not sure). But, trying to simplify it for myself, I thought I would start easy: change the escaped html to tags, forget about the 'See ' for a moment, and just try to figure out how to 'remove' (literally) the full tag spec. So, that would leave me with:
Code: Select all
<clebook id="rec"><ebook-link eISBN="9780538475327" contextualized="true" chapterName="Effective and Ethical Communication at Work" sectionName="Communication Skills and You">pages 4-5.</ebook-link></clebook>
After reading awhile I concluded that since I had an opening and closing tag, surely the example scripts that would "find any tag and everything in it" would work. I tried these two variants in the 'search' field in textpad:
Code: Select all
<clebook\b[^>]*>(.*?)</clebook>
and
<clebook id="rec"\b[^>]*>(.*?)</clebook>
It just tells me it can't find it.
In a perfect world, I'd work out a regex that used the escaped code these files are coming to me with, and get rid of the 'See ' that leads these too, as that's what really needs doing. But I can't even figure out the tag part. I am really dense apparently!
I think there must be something I am fundamentally misunderstanding about how this works. Any pointers would be greatly appreciated.
Best,
PJ