Someone recently taught me a useful thing: in css you can write the following:
input[id^=start_of_name]
which will allow you to select all inputs with an id starting with ‘start_of_name’. Can you do the equivalent for choosing the end of the name? The middle?
[att^=val]
Represents an element with the att attribute whose value begins with the prefix “val”. If “val” is the empty string then the selector does not represent anything.
[att$=val]
Represents an element with the att attribute whose value ends with the suffix “val”. If “val” is the empty string then the selector does not represent anything.
[att*=val]
Represents an element with the att attribute whose value contains at least one instance of the substring “val”. If “val” is the empty string then the selector does not represent anything.
Source: http://www.w3.org/TR/css3-selectors/#attribute-substrings