private bool SetTextSelection(string regex)
        {
            bool success = false;

            try
            {
                Regex regexSelect = new Regex("(?<Select><[^<]+?>)");
                Match match       = regexSelect.Match(regex);
                Group g           = null;

                if (match.Success)
                {
                    g = match.Groups["Select"];

                    EditLocationRange foundRange =
                        txtRegex.Find(txtRegex.CurrentLineChar,
                                      g.Value, true, true, true,
                                      false, false, false, true);

                    int lnStart = txtRegex.CurrentLineChar.L;
                    int chStart = txtRegex.CurrentLineChar.C - regex.Length;
                    txtRegex.Focus();
                    //txtRegex.Select(foundRange);
                    txtRegex.Select(lnStart, chStart + g.Index, lnStart, chStart + g.Index + g.Length);
                    success = true;
                }

                else
                {
                    txtRegex.SelectionLocationRange.Start = new EditLocation(txtRegex.SelectionLocationRange.Start.C,
                                                                             txtRegex.SelectionLocationRange.Start.C + g.Index);
                    success = false;
                }

                txtRegex.Focus();
                return(success);
            }
            catch (Exception e)
            {
                string s = e.Message;
                return(false);
            }
        }