Post Reply 
More than one match/replace per filter?
Sep. 13, 2011, 04:00 AM (This post was last modified: Sep. 13, 2011 12:20 PM by JJoe.)
Post: #3
RE: More than one match/replace per filter?
A quick bit more.

Example A
Match "$LST(Trans)"
Replace "\1"
List entries "eins $SET(\1=one)"

Problem with "A" is the list will be called every time the filter tests code and "eins" may change einstein to onetein.

Example B
Match "(\s|>)\2$LST(Trans)"
Replace "\2\1"
List entries "eins(^[a-z]) $SET(\1=one)"

Calling the list after a match has been made would speed things up. (^[a-z]) looks for the end of the word.

Example C
Match "(\s|>)\2([a-z]&$LST(Trans))"
Replace "\2\1"

Calling the list only when it may match could be better still. ([a-z]&$LST(Trans)) should call the list after a letter is found.

You could also use "(\s|>)\2(^(^[a-z]))$LST(Trans)". (^(^[a-z])) tests for but does not remove a letter, a-z.

Problem with A-C is that all text may be matched, not just rendered text.

How will you prevent matching in tags, scripts, and other 'hidden' text?

HTH
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: More than one match/replace per filter? - JJoe - Sep. 13, 2011 04:00 AM

Forum Jump: