示例#1
0
		private Match (Regex regex, IMachine machine,
						GroupCollection groups,
						string text, int text_length,
						int index, int length, int n_caps)
			: base (text, index, length, n_caps) {
			this.regex = regex;
			this.machine = machine;
			this.text_length = text_length;

			this.groups = groups;
			groups.SetValue (this, 0);
		}
示例#2
0
        private Match(Regex regex, IMachine machine,
                      GroupCollection groups,
                      string text, int text_length,
                      int index, int length, int n_caps)
            : base(text, index, length, n_caps)
        {
            this.regex       = regex;
            this.machine     = machine;
            this.text_length = text_length;

            this.groups = groups;
            groups.SetValue(this, 0);
        }
示例#3
0
        private void AddGroup(Matcher m, GroupCollection groups, int javaGroupNumber, string text, Match match)
        {
            int netGroupNumber = _patternData.JavaToNetGroupNumbersMap [javaGroupNumber];

            if (netGroupNumber == -1)
            {
                return;
            }

            int index = m.start(javaGroupNumber);

            if (index < 0)
            {
                if (groups[netGroupNumber] == null)
                {
                    groups.SetValue(new Group(), netGroupNumber);
                }
                return;
            }

            Group group = new Group(text, index, m.end(javaGroupNumber) - index, match, netGroupNumber);

            groups.SetValue(group, netGroupNumber);
        }
示例#4
0
		private void AddGroup (Matcher m, GroupCollection groups, int javaGroupNumber, string text, Match match) {
			int netGroupNumber = _patternData.JavaToNetGroupNumbersMap [javaGroupNumber];
			if (netGroupNumber == -1) {
				return;
			}

			int index = m.start (javaGroupNumber);

			if (index < 0){
				if(groups[netGroupNumber] == null) 
					groups.SetValue (new Group (), netGroupNumber);
				return;
			}

			Group group = new Group (text, index, m.end (javaGroupNumber) - index, match, netGroupNumber);

			groups.SetValue (group, netGroupNumber);
		}