- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Related to my earlier question an Just in case there’s a genius on these forums who can help me!
I need a Regular Expression that will find all text between two words (not tags)
example:
test
..html code
..html code
..html code
test
find all code between the words “test” and replace
I’m busy with regular expressions atm too.
Have a look at this site, it’s really helpful.
/(?<=test)(.+?)(?=test)/g
That gets everything between test and test – Provided it’s on the same line. I’m busy working on a solution to that atm.
Also, something quite annoying.
(?<=test) – That is a lookbehind
(?=test) – That is a lookahead
Javascript doesn’t support the lookbehind (php does)
So that’s pretty annoying. I’m trying to find a proper work around to that too.
Thanks Jamy
/(?<=test)(.+?)(?=test)/g Seems to be invalid in my Dreamweaver. I don’t know why this has proven to be so tricky, tbh. Would have thought grabbing text between two deliminaters -without having to figure out codes – would be a pretty standard text editor feature. I’ll offer some beer money to anyone who can come up with a solution :) (as well as finding between “test” it’d be cool if it found the “test”s as well, ready for deleting the entire block)
Found a freeware prog, solves my problem and might be useful to some:
http://www.davidpye.com/index.php?page=freeware
text magician
Enter begin word in box
Enter End word in another box
click a button to delete everything in between.