'Запрет ввода определенных символов с буфера обмена.
Private Sub Text1_Change()
Dim selst As Long, selln As Long
With Text1
selst = .SelStart
selln = .SelLength
.Text = Replace(.Text, " ", "")
.SelLength = selln
.SelStart = selst
End With
End Sub
Private Sub Command1_Click()
Dim b As Long
Dim e As Long
Dim tmp As String
tmp = Text1.Text
b = InStr(1, tmp, "=")
If b = 0 Then Exit Sub
b = b + 1
e = InStr(b, tmp, ";")
If e = 0 Then Exit Sub
tmp = Mid$(tmp, b, e - b)
tmp = Replace(tmp, "'", "")
tmp = Trim$(tmp)
MsgBox tmp
End Sub
Private Sub Text1_Change()
Dim selst As Long, selln As Long
With Text1
selst = .SelStart
selln = .SelLength
.Text = Replace(.Text, "window.location", "")
.Text = Replace(.Text, "=", "")
.Text = Replace(.Text, "'", "")
.Text = Replace(.Text, ";", "")
.Text = Replace(.Text, "?", "")
.SelLength = selln
.SelStart = selst
End With
End Sub
Saturn.65 писал(а):Правда ковычки не знаю как убрать.
Replace (Text1.text, """","")
gjghjc писал(а):
- Код: Выделить всё
Replace (Text1.text, """","")
Кажется так
Dim sLink As String
sLink = Mid("myString", InStr("myString;", "='") + 1)
sLink = Left(sLink, InStrRev(sLink, ";") - 2)
Dim myRegExp As New RegExp ' создаём экземпляр RegExp'a
myRegExp.MultiLine = True ' текст многострочный
myRegExp.Global = True ' будем проходить всю строку
myRegExp.IgnoreCase = True ' игнорируем регистр символов
myRegExp.Pattern = "(window.location=')(.*?)(')" ' маска
Dim aMatch As Match ' один из совпавших образцов
Dim colMatches As MatchCollection ' коллекция этих образцов
Dim testString As String ' тестируемая строка
Set colMatches = myRegExp.Execute(Text1.Text) ' запускаем
For Each aMatch In colMatches ' проходим по всей коллекции
List1.AddItem aMatch.SubMatches(1)
Next aMatch
url = Split(MyHardString, "'")(1)
Dim lUrlStartPos As Long
lUrlStartPos = instr(1, MyHardString, "'")+1
url = Mid$(MyHardString, lUrlStartPos, Instrrev(MyHardString, "'")-lUrlStartPos)
Dim i as long
Select Case X
case is > 0
for i = 1 to x
z = z +1
next i
case is < 0
for i = -1 to x step -1
z = z - 1
next i
end select
Select Case y
case is > 0
for i = 1 to y
z = z +1
next i
case is < 0
for i = -1 to y step -1
z = z - 1
next i
end select
z = x + y
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 71