You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace Swift.web.Library
  6. {
  7. public class UtilityRegExp
  8. {
  9. /// <summary>
  10. /// <para>A Regular Expression to Match any null Json object in a string</para>
  11. /// <para>like "Samaj_Shekhar":null,</para>
  12. /// <para>Useful in removing nulls from serialized Json string</para>
  13. /// </summary>
  14. public static string JsonNullRegEx = "[\"][a-zA-Z0-9_]*[\"]:null[ ]*[,]?";
  15. /// <summary>
  16. /// <para>A Regular Expression to Match an array of null Json object in a string</para>
  17. /// <para>like [null, null]</para>
  18. /// <para>Useful in removing null array from serialized Json string</para>
  19. /// </summary>
  20. public static string JsonNullArrayRegEx = "\\[( *null *,? *)*]";
  21. /// <summary>
  22. /// <para>A Regular Expression to Match an Email Address</para>
  23. /// <para>Useful in validating email addresses</para>
  24. /// </summary>
  25. public static string ValidEmailRegEx = @"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$";
  26. }
  27. }