Home > front end >  Asp regular characters to replace
Asp regular characters to replace

Time:09-24

Hello, world

How to use the regular all & lt; Span> Replace & lt; Input type='text' & gt; CodePudding user response:

 
STR="& lt; Span> Hello, world Hello, world_2 & lt;/span> Hello, world_3 & lt;/span>"
Set the RegEx=New RegExp
The RegEx. Global=True
The RegEx. IgnoreCase=True
The RegEx. The Pattern="& lt; Span> ([^ & lt;] +? <\/span>" '" [a-z] (\ d +) [a-z] {3} "
STR=regex. Replace (STR, "& lt; Input type=hidden value='https://bbs.csdn.net/topics/$1' & gt;" )
Set the RegEx=Nothing
Response. Write the STR

CodePudding user response:

reference 1st floor qq_63572063 response:
 
STR="& lt; Span> Hello, world Hello, world_2 & lt;/span> Hello, world_3 & lt;/span>"
Set the RegEx=New RegExp
The RegEx. Global=True
The RegEx. IgnoreCase=True
The RegEx. The Pattern="& lt; Span> ([^ & lt;] +? <\/span>" '" [a-z] (\ d +) [a-z] {3} "
STR=regex. Replace (STR, "& lt; Input type=hidden value='https://bbs.csdn.net/topics/$1' & gt;" )
Set the RegEx=Nothing
Response. Write the STR


Thank you, now have these data, AA, BB, CC

How will these data by ", "division after matching the Input inside here

STR=regex. Replace (STR, "& lt; Input type=hidden value='https://bbs.csdn.net/topics/AA' & gt;" )
STR=regex. Replace (STR, "& lt; Input type=hidden value='https://bbs.csdn.net/topics/BB' & gt;" )

Like this,

CodePudding user response:

Such as & lt; Span style='font - size: 4 px & gt; Asfsfsdfs How to remove & lt; Span> And & lt;/span> , leaving only asfsfsdfs text

CodePudding user response:

 s="& lt; Span style='font - size: 4 px & gt; Asfsfsdfs" 
Dim RegEx, RegMatches
Set the RegEx=New RegExp
The RegEx. The Pattern="& lt; Span ([^ & gt;] +?> ([^ & lt;] +? <\/span>"
The RegEx. Global=True
The Set RegMatches=RegEx. Execute (s)
For Each RegMatch RegMatches In
Response. Write RegMatch. SubMatches (1)
Next
  •  Tags:  
  • ASP
  • Related