Ik heb bijvoorbeeld string die dit bevat:
nu wil ik in asp het deel wat tussen de "" in het stuk van {@include("")} zit, ik heb het hier mee geprobeert maar dan pakt hij het hele stuk
"{@include\((.*?)\)}" hier krijg ik als match uit {@include("file.tpl")} maar ik wil alleen file.tpl hebben hoe los ik dit op
Ik gebruik op dit moment deze code:
code:
1
| {@include("test1.tpl")} main body {@include("test2.tpl")} |
nu wil ik in asp het deel wat tussen de "" in het stuk van {@include("")} zit, ik heb het hier mee geprobeert maar dan pakt hij het hele stuk
"{@include\((.*?)\)}" hier krijg ik als match uit {@include("file.tpl")} maar ik wil alleen file.tpl hebben hoe los ik dit op
Ik gebruik op dit moment deze code:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| <%
Dim objRE
Dim objMatches
Dim objMatch
Dim strExample
Set objRE = New RegExp
objRE.Pattern = "{@include\((.*?)\)}"
objRE.Global = True
strExample = "{@include(test1.tpl)} main body {@include(test2.tpl)}"
Set objMatches = objRE.Execute(strExample)
If objMatches.Count > 0 Then
For Each objMatch In objMatches
Response.Write objMatch.Value & " found at position "
Response.Write objMatch.FirstIndex & "<br>"
strExample = objRE.Replace(strExample, "vervanging")
Next
End If
%> |
[ Voor 8% gewijzigd door 4Real op 07-09-2004 12:04 ]