snowboardr
Programmer
I am trying to figure out regular expressions, i am terrible at them, I got it to where it will put a link one QXXX x being a number, however i dont know how to get it to where it would do Q and then any ammount of numbers after it....
Thanks
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]
Thanks
Code:
<%
function ereg(strOriginalString, strPattern, varIgnoreCase,strReplaceWith)
dim objRegExp : set objRegExp = new RegExp
with objRegExp
.Pattern = strPattern
.IgnoreCase = varIgnoreCase
.Global = True
end with
ereg = objRegExp.replace(strOriginalString, strReplaceWith)
set objRegExp = nothing
end function
'(Q+\d{3}(?!\d)) = 3 numbers only
Response.write ereg("This is a test i want to see if reg exp Q265 can spot post number Q344 and then output as a link", "(Q+\d{3}(?!\d))", False,"<a href=""/post/?id=$1"">Q$1</a>")
%>
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]