Regular Expression :: Eginning Symbol ^ Or The End Symbol $

would this work if i only wanted the user to enter any number of letters?[a-zA-Z]*

would i need to add the beginning symbol ^ or the end symbol $ ?

View Replies


ADVERTISEMENT

The ' Symbol..

I have a database query where it looks like this

strQuery = "UPDATE resource SET TITLE = ' "&request.form("TITLE")&" ' WHERE
ID = '"&request.form("ID")&"';"

the problem is that if the field called title has a ' in the text then the
UPDATE fails, because I have closed the TITLE field early. If I reverse the
" & ' marks then I will have the same problem but the opposite way
I thought about doing something with ASP, replace but I still cant get round
the fact that I will have a ' in the UPDATE statement
Can I do something like REPLACE ' with the CHAR code value and add the code
in the SQL record, and will this display the ' or the code.

View Replies View Related

<> Symbol ?

anyone know what does the symbol <> means?
Example: Remove_Id <> ""

View Replies View Related

Avoid Symbol ' In The URL

how to elaborate this problem that i m facing. ok, let say ..i have a URL wit id number such as www.abc.com/memberpage.asp?memberid=12.

when i add the symbol ' at the end of the url (like that:www.abc.com/memberpage.asp?memberid=12'), and enter, it will display error for my page.

But when i try to put a ' at this web page here, it will not display any error, how can i do this with ASP languagE?how can i avoid it using ASP language ?

View Replies View Related

Amp; Symbol In Code

I ran my page through the W3C markup validator, and all's well except one thing. If I have the "&" symbol in my URLs, it says: Quote:

Line 143, column 66: cannot generate system identifier for general entity "cat"
Line 143, column 69: reference not terminated by REFC delimiter
Line 143, column 69: reference to external entity in attribute value

I tried doing "&-amp;" (without the -) and "%26" but even though %26 works for the validator, my ASP script doesn't know it's an amp.

View Replies View Related

Different Decimal Symbol

I have ASP code displaying currency datatype data from Access database. I have copies of this asp code and tha database on two w2k/IIS5 computers, bothg having the decimal symbol set to "." in the Regional setting both for numbers and for currency. However on one PC it shows dots, while on the other - commas. What is actually controlling which decimal shows up?

View Replies View Related

Currency Symbol

Wondering if anyone can help me with this annoying problem. I want to display a (£) on an ASP page, but it keeps putting a J instead. I've tried formatcurrency on the variable that it displays, but still comes up as a J and I've tried changing session.LCID to 2057. Still shows a J.

If you check View Source it shows the £ but it shows as a J on the page. If you check on IE under View... Encoding it comes up as Cyrillic (Windows) and if you change this to Western European (Windows) the page refreshes and shows fine; £ signs come up. But, as soon as you click on a link, it reverts back to Cyrillic.

View Replies View Related

Pass And & Symbol In A Query String

Is it possible to pass an -- & symbol --- in a query string.

ie: varialbe = Purple & Pink

page.asp?var=varialbe

-->> With this I get: Purple%20&%20Pink Passed through and the query string only picks up on the Purple.

View Replies View Related

' Symbol In Uploaded Filename - Not Working

I have a form which enters a URL into a file field in my database: E.G.

R:ConfidentialControlledWork.txt goes into field file_path_complete

However if the file name contains a ' character E.G.
r:confidentialjon's work.doc

Then it will not work correctly on my display page, as any text after
the ' will be ignored leaving it as r:confidentialjon

Here is how I create a link to this document on my display page ...

Response.write "<a href='"&rsNOTES("File Path Complete")&"'>"
Response.write (rsNOTES("File Name"))

With rsNotes(File Path Complete) being the full path and filename.

View Replies View Related

Regular Expression

Can anyone give me a regular expression for finding a URL in a string of
text?

Essentially what I want to do is find URLs in a text string and embed
them in {a href...} tags. However, I haven't used regular expressions
all that much in ASP/VBSCRIPT.

View Replies View Related

Regular Expression

I need to create a regular expression for a date field that works only
in the following format MM/DD/YYYY with the / in the format. No other
format can be inputted into the field. I need 2 numbers for MM 2
Numbers for DD and 4 numbers for YYYY. If the users enter 1 number for
month, 1 for day he should get an alert.

I have this code and thought it was working but it is not.

var RegExPattern = /(d{1,2})W(d{1,2})W(d{4})/;

View Replies View Related

Regular Expression

i know there are tutorials for Regular Expressions too, but can a 'simple' example be posted in these forms

View Replies View Related

Regular Expression

I'm going down the road of learing the pattern matching in regular
expressions, and I'm trying to convert the characters into English in my
head so I can see whats happening...

For clarity with this one...

[b]([^]]+)[/b]

Ok - the first thing I did was break it up - because it looks a nightmare
like that...so now I have..3 parts..

[b]

([^]]+)

[/b]

In part 1 I under stand that the is telling the expression that a special
character is coming next, thus escaping the [ and ] respectively, thus ,
and in part 3 I understand the same and also the escaping of the /, thus
- no problems so far...

In part 2 I'm assuming that the brackets are seperating a "pattern" so that
I might reference it as $1 later on, I understand that the [^] are saying
"not enclosed" so therefore it's going to ignore a ], the + sign however
perplexes me - my VBScript book says "Matches the preceeding character one
or more times" - so does that mean the ] just before it, or does it mean the
character OR characters defined within the [ ] etc?

View Replies View Related

Regular Expression Example

looking for a regular expression example for asp in vbscript. just want to search for a name in some text, possibly display that text.

View Replies View Related

Regular Expression

I'm trying to find a regular expression function to strip contents out of a string which lie between square brackets [].I've got one for chevrons (to remove HTML - as below), but would prefer not to have to replace the chevrons for square brackets first.Code:

function funRemoveHTML( strText )
Dim RegEx
Set RegEx = New RegExp

RegEx.Pattern = "<[^>]*>"
RegEx.Global = True

funRemoveHTML = RegEx.Replace(strText, "")
end function
how I can modify this for square brackets as opposed to chevrons?

View Replies View Related

Regular Expression For URL

I am working on an ASP page which looks in a set of text for web page URLs.

Using the VBScript.RegExp regular expression object, I have this regular
expression:

[a-z]+.[a-z]+.[a-z]+/

And it works well finding URL's such as: windowsupdate.microsoft.com,
www.cnn.com, etc.

However, I have been trying to modify it to ALSO find URL's like this:

www.amazon.com/index/sell/ie6.html?val=1
Or
www.microsoft.com/windowsxp

Any ideas?

View Replies View Related

Regular Expression

I'm making url's out of text starting with "www" etc. but I've got two problems. Firstly, if the string begins with www it doesn't get matched, and secondly, if there's a dot or a comma directly after the url, it becomes part of the url. I hope someone who is better at this than me will be able to help me out. Code:

reg.Pattern = "(s)(www)(S)(S+)"
s = reg.Replace(s, "$1<a href=""http://$2$3$4"" target=""_blank"">$2$3$4</a>")

View Replies View Related

Understanding Regular Expression

I have been using a regular expression that I don’t uite understand to
filter the valid email address. My regular expression is as follows:

<asp:RegularExpressionValidator id="valValidEmail"
runat="server"
ControlToValidate="txtEmail"

ValidationExpression="^([_a-z0-9-]+)(.[_a-z0-9-]+)*@([a-z0-9-]+)(.[a-z0-9-]+)*(.[a-z]{2,4})$"
ErrorMessage="Invalid Email address."
Display="None">
</asp:RegularExpressionValidator>

Can someone explain me why the email address Join Bytes! is
considered an invalid email address?

Also can someone explain me what the above regular expression means?

View Replies View Related

Regular Expression Syntax..

I need to parse the following:

aaa_bbb_d_yyyy_mm.ext

aaa = ITM, CPF, FAC, GEN
bbb = almost anything (even more then 3 chars)
d = M,Q,Y,R
yyyy = year
mm = month

I'm terrible at figuring out regexp so I turn to the kind folk of SP

View Replies View Related

Regular Expression Problems

I have a field that should take a date in the following two formats:

MM/DD/YYYY or MM/DD (and assume it is this year, it will fill in current year)

I have my program checking against two regular expressions. The first one is ok:

Dim regEx
Set regEx = New RegEx

regEx.Pattern = "^(([1-9])|10|11|12)/(([1-9])|((1|2)[0-9])|30|31)/200[0-9]"

If the date checked comes up False, it then goes to this expression:

regEx.Pattern = "^((0[1-9])|(10|11|12))/((0[1-9])|((1|2)[0-9])|30|31)"

My problem is on the second one. If I enter an erroneous date like this: 11/189

It will go through and crash my program.

View Replies View Related

Problem With Regular Expression

I am using regular expression to replace the text, This is asp function I have used to replace the text, but it’s not working properly Code:

View Replies View Related

Regular Expression :: Replace

addContent = replace(addContent,"<font>","")

Right, pretty simple eh!

However, what I need is something to say replace all occurence of strings that start with "<font" to eb replaced by zilch i.e.

<font>
<font color=green>
<font tag=this another=more>

I believe regular expression are the way to go?

View Replies View Related

Regular Expression :: AlphaNumeric Only

any one have a quick regex for making sure that only 0..9 a..f are in a string?

View Replies View Related

Regular Expression :: Object

I'm trying to return a sub string using the regular expression object. I've not really used the regular expression object before and I'm finding it a bit clunky to use.

Basically I'm trying to match the 'description' within the string 'file_description_1'

However I'm unsure how to return the partial, would I use the Execute or Replace methods?

Regex looks like this:

With RegularExpressionObject
.Pattern = "file_(.*?)_[0-9]"
.IgnoreCase = False
.Global = True
End With

View Replies View Related

VBScript Regular Expression Object

I've discovered an insidious bug with the VBScript Regular Expression
object.I set the pattern to consist of the set of invalid filename
characters plus comma. I set global property to true then do a replace on a
SID. The Replace does nothing. However, if I attach the C++ (dev studio
2003) debugger to the IIS host process (dllhost.exe), every time I call
RegExp.Replace, the stack for one of the process's threads gets scrambled.
It ends up with the value 0x00000001 at the top of the stack! If your
debugger is set to stop on access violations, it always catches one (invalid
read trying to delete). The problem is insidious because, without the
debugger running, you would never know this is happening. ASP returns no
error. Potentially this could wreak havoc on your web application and cause
bizarre failures later on. Has anyone else run into this one? It seems to
happen only with the Replace method.

View Replies View Related

Regular Expression In Scripting Engine 5.1

I need a regex pattern that will grab a select or textarea tag in an HTML file. If I run
the pattern I should get:

<select name="whatever">
<option value="a" selected>A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>

Or

<textarea name="whatever">Here is some text area text</textarea>

I know the following pattern works:

<(select|textarea).*(.|
)*?</(select|textarea)>

But the problem is my web hosting company is using ASP scripting engine 5.1 which does not support the non greedy delimiter (?). I doubt they are going to upgrade to 5.5 anytime soon.

I'll appreciate it if anyone can give me a pattern that does the same job but does not use the ? delimiter. Is there a way I can tweak the pattern above so that it works in ASP scripting engine 5.1?

View Replies View Related

Regular Expression :: Pick Out SQL Statement

I'm trying to work out a reg.exp. that will pick out a sql statement against a certain set of tables - in this case any table named "Survey~something~", but I only want to pull back those statements where the CompanyID column doesn't appear in the query. (The expression is being used in my editor so it might appear a little strange, but by and large it works the same as you'd expect.)

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}

What do I need to add so that I get those without a companyid column?
Something like...

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}(^companyid)

(tried this one, but it doesn't work)

View Replies View Related

Replacing Words Regular Expression

I have a search results page that lists a series of records with clickable links to view the records. When you click on the link to the record, the record id, the search terms used, and the search type (exactphrase or anywords) is sent through the query string.

On the record page I have been trying to find a regular expression that would find and replace the search terms with < strong >< /strong > to highlight them. I am struggling.

Does any use a similar regular expression. One that, if flagged, will replace an exact string (phrase) or loop through an array replacing any of the words in the string?

View Replies View Related

Regular Expression :: Extract Links

here is a pattern I am using in regexp module:
href(.*?)[x22>][^x22]*x22

This string seems to work in that it will return
href = "http://www.domain.com"

from href tags such as this.
<a href = "http://www.domain.com">This is a link</a>

it handles the spaces that may exist before and after equal sign. (basically I am trying to extract links out of my url)

is there a way I can take this pattern a bit further to return just the http://www.domain.com

I am new to regexp but have managed to get this far.

View Replies View Related

Regular Expression :: Wrapper Function

I'm trying to write a function to return submatches. I want to do this because I want to run a match on matches of matches of yet other matches, so it seemed to me it would be easier to work with if there was one line of code that would return a collection or array of matches. Here's what I got:

<%
Dim objRegExp
Set objRegExp = New RegExp
Dim objMatches, objMatch

Set submatches = getsubmatches("this should hopefully match and print
eight words", "(w)", TRUE, TRUE)

For i = 0 To submatches.Count - 1
response.write "<br>" & submatches(i)
Next


Function getsubmatches(strText, pattern, isGlobal, ignoreCase)
Dim data

'Set our pattern
objRegExp.Pattern = pattern
objRegExp.IgnoreCase = ignoreCase
objRegExp.Global = isGlobal

For Each objMatch in objRegExp.Execute(strText)
getsubmatches = objMatch.SubMatches
Next
End Function

%>

I get:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment
/getsubmatches.asp, line 22

thats this line: "getsubmatches = objMatch.SubMatches"

Can anyone help me write this correctly?

View Replies View Related

Regular Expression :: Delete Characters

eg: AAA, BBB, CCC (3 items) in the lists.

i would like to remove BBB and make it become AAA, CCC

anyone know how i can do it in regular expression?

it is possible to remove 1st, or 3rd items. but only all items inside is identical. and only remove single item.

View Replies View Related

Regular Expression :: Phone Numbers

If I want my phone number like this...

(XXX)XXX-XXXX

([0-9]{3})[0-9]{3}-[0-9]{4} ....

View Replies View Related

Regular Expression :: And Session Variables

I'm back with something that makes no sense to me .... as far as I can see the three if statements are identical except for the input. One is the regular phone, then cell phone and then the fax .....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved