Search the web
Sign In
New User? Sign Up
xrules · XRules & DynamicDOM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How can control data format with XRule?   Message List  
Reply | Forward Message #55 of 74 |
RE: How can control data format with XRule?

You can use the regex attribute of the <bind> rule to select a regular
expression to match your format. Here is an example I made up. You can find
excellent regular expression examples at http://regexlib.com/


<xr:rules xmlns:xr="http://www.xrules.org/2003/11">
<xr:ruleset context="/Contact">
<xr:bind target="Phone" regex="'^[+]?\d{1,3}-\d{2}-\d{1,7}$'" />
<xr:bind target="Email" regex="'\w+@\w+.(com|org|net)'" />
<xr:bind target="ZipCode" regex="'\d{3}-\d{3}-[A-Z]{3}-\d{3}[A-Z]'" />
</xr:ruleset>
</xr:rules>


Regards,
Waleed



-----Original Message-----
From: radobject [mailto:radobject@...]
Sent: Saturday, January 13, 2007 6:03 PM
To: xrules@yahoogroups.com
Subject: How can control data format with XRule?

Hi,

I have a question about How I can control email,phone,... format with
XRule.

<Contact>
<Phone>+98-21-2222222</phone>
<Email>Radobject@...</Email>
<ZipCode>123-456-ARC-555A</ZipCode>
</Contact>

Best regards





Sun Jan 14, 2007 5:53 am

waleed_ka
Offline Offline
Send Email Send Email

Forward
Message #55 of 74 |
Expand Messages Author Sort by Date

Hi, I have a question about How I can control email,phone,... format with XRule. <Contact> <Phone>+98-21-2222222</phone> <Email>Radobject@...</Email> ...
radobject
Offline Send Email
Jan 14, 2007
3:26 am

You can use the regex attribute of the <bind> rule to select a regular expression to match your format. Here is an example I made up. You can find excellent...
Waleed K. Abdulla
waleed_ka
Offline Send Email
Jan 14, 2007
5:53 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help