RegExpInstance.cs 820 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Text.RegularExpressions;
  2. using Jint.Native.Object;
  3. namespace Jint.Native.RegExp
  4. {
  5. public class RegExpInstance : ObjectInstance
  6. {
  7. public RegExpInstance(Engine engine)
  8. : base(engine)
  9. {
  10. }
  11. public override string Class
  12. {
  13. get
  14. {
  15. return "RegExp";
  16. }
  17. }
  18. public Regex Value { get; set; }
  19. //public string Pattern { get; set; }
  20. public string Source { get; set; }
  21. public string Flags { get; set; }
  22. public bool Global { get; set; }
  23. public bool IgnoreCase { get; set; }
  24. public bool Multiline { get; set; }
  25. public Match Match(string input, double start)
  26. {
  27. return Value.Match(input, (int) start);
  28. }
  29. }
  30. }