You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by "Kataria, Satish" <Sa...@fmr.com> on 2005/09/12 06:09:48 UTC

Help required in making a regular expression

Hi,
I have the following schema definition :
The requirement is to not allow  leading and trailing spaces.

	<xsd:simpleType name="Comment_T">
		<xsd:annotation>
			<xsd:documentation>
				Comment text
			</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="2000"/>
			<xsd:pattern value="(\S(?:.*\S)?)"/>
		</xsd:restriction>
	</xsd:simpleType>

Now I need to change it so that following expression are also not
allowed : NONE, N/A, =, !=, <, >, <=, and >=
Note that The symbols shouldn't be contained in any part of the data
provided as part of Comment_T.
Thus a string like SNONE or sN/Ass or s<dd are also invalid values.

I am not able to make out the appropriate regular experession which
would meet this requirement. 
I will appreciate any suggestions regarding this.

Thanks,
Satish Kataria