Quick Regex Question
I need a pattern to do this:
"?caid=[0-9]+&pgid=oRS("pgId")"
Where [0-9]+ means you need atleast 1 number there, the rest is just a string plus my recordset's variable. I know this syntax would work with the regex I learned at school but I'm not sure how to make it work in ASP.
View Replies
ADVERTISEMENT
im using cdosys to send an email from an asp page. is there a way i can insert the current page as the body of the email? i know i can send an HTMLBODY and specify a url.... but that wont work because the page is dynamically generated... so i need to be looking at a page, click a button and have the html of that page inserted as the body.
View Replies
View Related
i want to run some code is a certain condition is met and i can't figure this part out
i want if the button is pressed then will run my code else will run my other code
but how do i specify this button. if "button" is pressed?
View Replies
View Related
how can I count specific charaters in a string?
like the amount of backslashes in-
"D:Inetpubsite hisstring"
View Replies
View Related
How do I force the order of a SQL query?
My table has a field called ModelName which could contain 1 of 5 vehicle
models. I want to force the query to order these in a particular order (not
alphabetical, but an order that I have determined ('Range Rover',
'Discovery', Land Rover', 'Jeep', 'Others')
Let's say my current query is:
"SELECT DISTINCT ModelName FROM tblVehicles"
What do I need to tag on the end to order the result as stated?
View Replies
View Related
1)How can i work out if a certain user is still online? All the pages the user will be able to view has a "check this password etc etc" so i could work it out that way, but would prefer to try and use sessions
2)Work out when a visitor last visited the site. I would like it so that this is only updated when the user LEAVE the site or CLOSES the browser - so it cant be updated on every page
3)Work out what users are on what pages. Again will probably mean sessions but how?!
4)Work out what pages (threads) the user has looked at. I know both vbulletin and snitz do something with the users last visit (question 2) and the last post...but how does it work
View Replies
View Related
On the DATE function, if I want to delete everything that is more than 30 days old,
would I check for DATE-30?
View Replies
View Related
I building a page showing the different times in different parts of the world but if the local time is 08:15:25 and I subtract 10 hours, it displays 0-2:15:25. How can I show it as 22:15:25.
View Replies
View Related
Im looking since the begining of the week about saving the enter(vbcrlf) from the html <textareato my MySql database, it save everything but it just loose everything when saving ot the database, do i need a special component to be able to save the enter and tabs etc. Im sure i was able to do it before and it was easy.
View Replies
View Related
I have been trying for days to learn regex, can't seem to get to grips with it at all .
Basically I need to remove all text between strings.
abcdef <mytag>ghijkl</mytag> mnopqr
would be left with
abcdef mnopqr
View Replies
View Related
I am struggling to find a solution to a relatively easy problem I have a string which contains a date in the format of: 20 Sep 2007 14:24
I would like to strip everything off after the month, so I am left with '20 Sep' is there an easy way to do this?
View Replies
View Related
I have a text search which reads a textfile and displays each line that has a value the user is searching for. It's practically finished except when it searchs it doesn't look for exact matches (e.g a searh for Ali would return Alison or Alice).
How would i go about using RegEx's to prevent this by making the search look for the exact word entered? Code:
View Replies
View Related
I have this pattern to filter out bad words
regx.Pattern = "darn|dick|swear|blahblah"
it works, but in case of the word "dickinson"
the wordfilter also replaces dick in dickinson d***inson,
so i thought i could try this pattern
regx.Pattern = "darn|dick|swear|blahblah"
but no change, i've tested the regex with a similar PHP script and the operator works.
any clues why it wont work in asp?
View Replies
View Related
I am trying to do some custom forum code, like using [ b ] as a tag and replacing it later using RegEx. The problem is, its not replacing quite right. Its leaving in the []s and its not closing some of the tags.
Here is my pattern: "[ b ]((.|
)*?)[/ b ]"
Here is my replace text: "<b>$1</b>"
Here is some sample text: "yada yada yada [ b ]hey![/ b ] yada yada"
Now, another thing, I would like it to close tags if they aren't closed properly. Is this possible?
View Replies
View Related
im trying to use Regex to replace some text in my string. I want to replace some text to html tags eg. [b] to <b>, [u] to <u>.
How can I please use like a wildcard for the letter in between the tags. What am i doing wrong in this code, should i replace $1$2 to something else please: Code:
View Replies
View Related
Does anyone have a snippet to hand where i can create a dynamic dropdown for a credit card page, basically i need to dynamically create a drop-down populated with this year as 2006 and go back 4 years?
View Replies
View Related
if you have a function in an include file, and you copy that function and give it a different name.... and then you change the name in your call.. shouldn't it work just like the old function did?
View Replies
View Related
I m using MSQL and I m trying to create table where the first column is autoincremented, this, however, generates a syntax error. I can t figure out the problem:
Create Table tblAuthor (ID int(11) auto_increment,AuthorName varchar(200), primary key(ID));
Error Message: Line 1: Incorrect syntax near 'auto_increment'.
View Replies
View Related
can anyone tell me where i can get a good tutorial for a quick search.
View Replies
View Related
How can I add a quick drop down menu to an asp page? I've tried to incorporate javascript and I can't seem to make it work. I want it to replace the current navigation on this page.
http://www.compsports.com/poll.asp?No=1
View Replies
View Related
I made a regular expression to match Guitar Chords.
[A-G](#|b)?([a-z]|[0-9])*
This pattern should find any of the following:
1) G
2) Gmaj
3) G7
4) G#
5) Gb
6) G#min
The pattern works for all of these except for #4. For some reason it will only return the 'G' instead of the full 'G#'. I find this very odd because if the chord is 'Gb', the regex will return the full 'Gb'.This pattern works fine in javascript. Is there anything special with the '#' character in RegEx for VBScript? I am using VBscript engine 5.6
View Replies
View Related
I'm using regular expressions to identify in a string an url ad format it in hyperlink.
The problem is that in the same string should be bbcodes and the [url] one tooo... so when the regexp will format the code will format the one in bbcode too.
The solution would be the lookaround function of RegEx to see if behind the match there is the [url] code... but it's not implemented in VisualBasicScript. Is there any way to use this function in my script ?
View Replies
View Related
Is it possible to have more then one pattern for the .pattern variable. If I'm to execute and search and replace on a specific string can I make it so my .pattern will ignore specific keywords and not just A keyword?
View Replies
View Related
i have text, in it i want to highlight the words user used to find this result.
i used the normal replace, it worked fine except the case thing..
SearchForSp = Split(SearchFor, " ")
For i = 0 to Ubound(SearchForSp)
EmpJobsText = Replace(EmpJobsText, SearchForSp(i), "<strong><u><font
color=red>"&SearchForSp(i)&"</font></u></strong>", vbTextCompare)
EmpJobsText
next
i tried to use the regEx.Repalce from the examples in groups but just couldn't find a way. problem is in the normal replace function i have option to supply a source. in this case "EmpJobsText" is the source. but regEx.Repalce don't seem to have place to type where to replace, only what to replace with what.
View Replies
View Related
I want to add a "quick search" functionality in ASP or ASP.NET page. I heard
we can use Microsoft Indexing Service to accomplish the task, but not sure
how to do it. Is this the correct approach? Code:
View Replies
View Related
I have a string that I want to check to be sure there are no single or double quotes in it. Using RegEx should be possible but I cannot figure out how the syntax should go.
I am programming in ASP.NET with C# as the code behind.
here is one I know works to be sure there are only numbers in the string, but i can not for the life of me figure out the right syntax for quotes
View Replies
View Related
I am trying to write a regex function that will find all html tags with an id= value and get it to return the tag and value of the id.
i.e. <a href="blah.htm" id="someLink"> would return
a someLink
Any help would be greatly appreciated, this has got me very frustrated.
It will most likley be a very simple thing that I have missed.
View Replies
View Related
I have the following regex replace:
putDefInThis = RegExpReplace(putDefInThis, strPattern, "<a href=""" & lcase(replace("$1"," ","-")) & ".asp"">$1</a>")
The problem is that i can not get the vb replace to work on the "$1" in the url. $1 is such that it can be multiple words separated by a space. for the href, I need to convert the space to "-". It does not do that with the way I hvae the code above.
View Replies
View Related
how to add the symbol ' (Apostrophe) to the code so that the validation accepts this within a surname such as o'neill? this is wot i hav at the minute:
With regExName
.Pattern = "^[a-z]+$"
.IgnoreCase = true
.Global = true
End With
View Replies
View Related
What's a way (like, for a username) to allow lowercase and uppercase letter, and numbers?
Code:
objRegExp.Pattern = "[a-z][0-9]"
objRegExp.Global = True
objRegExp.IgnoreCase = True
That's what I have, but I want to make the letters or numbers OPTIONAL, but right now they are required. how can I fix that?
View Replies
View Related
Can someone tell the ALL the reserved characters for regex?
View Replies
View Related
i am using the following code to generate a xls file using the content type now when the user opnes the file at his pc it takes long time to open..if the no of records in file is large does the use of html tags has slow down the process of opening in excel. Code:
View Replies
View Related
I have the following regular expression:
re.Pattern = "style[^=]*=[^""]*""[^""]*"""
It will grab any style attribute within HTML that uses double quotes, and put it in the re.Matches collection.Now, I want to include single quotes into this regular expression. Here's what I have so far:
re.Pattern = "style[^=]*=[^""']*(""|')[^1]*1"
but it does not work.
View Replies
View Related