Hi dmander2,
as the forms and workflows are xmlObjects but not xpress replacing xpress would not really help. Plus you can do a lot with some fantasy, invoke and new:
<invoke name="matches">
<ref>date</ref>
<s>(((0[1-9]|[12][0-9]|3[01])([.])(0[13578]|10|12)([.])(\d{4}))|(([0][1-9]|[12][0-9]|30)([.])(0[469]|11)([.])(\d{4}))|((0[1-9]|1[0-9]|2[0-8])([.])(02)([.])(\d{4}))|((29)(\.|-|\/)(02)([.])([02468][048]00))|((29)([.])(02)([.])([13579][26]00))|((29)([.])(02)([.])([0-9][0-9][0][48]))|((29)([.])(02)([.])([0-9][0-9][2468][048]))|((29)([.])(02)([.])([0-9][0-9][13579][26])))</s>
</invoke>
validates a date in dd.mm.yyyy format taking leap years into account.
Yes it does work but no i'm not seriously thinking it is a good way to solve the problem :)
About Josephs problem i am not really sure. Simple shifting could always be done by multiplications or divisions by 2. While not as efficient that could be done in xpress. But for similar tasks like analyzing and modifying userAccountControl i used java in the past.
/**
* Tests if a certain bit is set within the String representation
* of a number ( userAccountControl ).
*
* Examples:
*"128","8"equates to null
*"127","16"equates to "true"
*
* @param String value representing a long integer.
* @param String bit representing the bit to test.
*
* @return String "true" if the bit is set, null otherwise.
*/
public static String testBit(String value, String bit)
{
long l = (new Long(value)).longValue();
long b = (new Long(bit)).longValue();
return ((l & b) == 0) ? "true":null;
}
/**
* Sets one or more bits (logical or) within a number.
*
* Examples:
*"128","8"equates to "136"
*"127","16"equates to "127"
*
* @param String value representation of a long integer.
* @param String bit representation of the bits to set
*
* @return (value OR bit) as a number in String representation.
*/
public static String setBit(String value, String bit)
{
long l = (new Long(value)).longValue();
long b = (new Long(bit)).longValue();
return String.valueOf(l | b);
}
/**
* Cleares one or more bits within a number
*
* Examples:
*"128","8"equates to "128"
*"127","16"equates to "111"
*
* @param String value representation of a long integer.
* @param String bit representation of the bits to set
*
* @return value with bit cleared.
*/
public static String clearBit(String value, String bit)
{
long l = (new Long(value)).longValue();
long b = (new Long(bit)).longValue();
return String.valueOf(l - (l & b));
}
Regards,
Patrick