The Un-Official Proxomitron Forum
Character '>' in Attribute Values - Printable Version

+- The Un-Official Proxomitron Forum (
+-- Forum: Proxomitron Config Sets (/forumdisplay.php?fid=43)
+--- Forum: Sidki (/forumdisplay.php?fid=44)
+--- Thread: Character '>' in Attribute Values (/showthread.php?tid=2064)

Character '>' in Attribute Values - neverwasinparis - Nov. 27, 2012 10:10 AM

in many config sets, also in Sidkis, '[^>]++' is used in pattern filters to find the end of an opening tag. but what about a '>' in an attribute value?
for example:

<div onclick="A>1 && B()">

'[^>]++' stops after '<div onclick="A' and does not get what we want and could create invalid code.

so why is '[^>]++' used? did really nobody ever thought about that case? or is it not worth to mind it because it's rarely used?

with that (just an example):

<div(\s( \w=$AV(*)| \w)\#++|)>

we get what we want. it works no matter how many '>' there are in attribute values. but it makes the code harder to read and slower. that's for sure. but i think it's worth it to get no errors. what do you think?

RE: Character '>' in Attribute Values - JJoe - Nov. 28, 2012 02:14 AM

(Nov. 27, 2012 10:10 AM)neverwasinparis Wrote:  so why is '[^>]++' used?

[^>]++ is used to make the matching expression fail (and maybe match) quicker.

Consider: <div >stuff<div onclick="A

where you want to find: <div onclick="A

An expression like <div[^>]++onclick="a will fail quickly at <div >.

<div*onclick="a will find the first <div and search past the first >. This wastes time and may reqire additional code to negate an unwanted match.

Of course, the rest of the expression must match what [^>]++ does not. sidki is very good at this. Wink