The Un-Official Proxomitron Forum

Full Version: Character '>' in Attribute Values
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
(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
Reference URL's