Regex - .net URL Rewriting (regular Expressions)?
Aug 20, 2010
As I have the URLs like
http://somedomain.com/products.aspx?id=1
and i want to rewrite this like
somedomain.com/productname and rest of the URLs on the domain work as they are provided.
like
somedomain.com/forums/categories.aspx
I don't want to rewrite these other URLs
View 1 Replies
Similar Messages:
Jul 28, 2010
i have the code:
Regex r = new Regex("<tag>([^<]*)</tag>");
but i want to add another set of tags to search between:
Regex r = new Regex("<tag>([^<]*)</tag>|<asd as="b">([^<]*)<asd as=j>");
this does not work.
View 1 Replies
Apr 1, 2010
if there are two consecutive apostrophe or two consecutive hyphens or two consecutive comma or two consecutive spaces or two consecutive periods or two consecutive periods..I want to display those particular error.
and One more thing is if there are any of the above combinations like apostrophe+hyphen or apostrophe+space or hyphen+space, I want to throw that specific error.
View 3 Replies
Mar 27, 2011
i take the text of the html of a site and want to select a substring of the whole text. the text is something like this
[Code]....
View 6 Replies
May 10, 2010
I think it can be solved by Regular expressions but maby I'm wrong.
I upload a .html file which is saved from a webbrowser. I read the stream and with Stringbuilder I make a string of it.But now I want to have only the data which is in this div:
[Code]....
View 6 Replies
Jan 27, 2010
I have two the below regular expressions for a textbox , to validate.
^(([01]?dd?|2[0-4]d|25[0-5]).){3}([01]?dd?|25[0-5]|2[0-4]d)$ - Validation Expression For IP Address
^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z]|[A-Za-z][A-Za-z0-9-]*[A-Za-z0-9])$ - Validation Expression for Host name
I want to use both these for the same textbox, It should fullfill either of these conditions. What should I do so as to satisfy my condition.
View 3 Replies
Feb 2, 2011
[Code]....
View 1 Replies
Apr 17, 2010
I am trying to search titles in this pattern a text. the titles are unknown and sometimes it contains special characters '(' and ')'.... when this is happens the only way to make the match correct is by replace ')' by ')' . is there a way ignoring this replacment? and if not, what are the complete meta(special) characters?
View 1 Replies
Jan 7, 2011
I want a limited amount of html tags for the user to be able to put in my form and by looking at the posts, regular expressions seem to be the way forward. I don't want to use javascript or 3rd party as this is for an assignment at university.
The examples I have found seem to be set out differently than mine with using asp id identifiers whereas my code below is set out differently so I am unsure if I can use these examples.
View 7 Replies
Feb 5, 2011
I am building a forum and I want to be able to use simple square bracket tags to allow users to format text. I am currently accomplishing this by parsing the string and looking for the tags. It's very tedious, especially when I run into a tag like this [URL]. Having to parse the attribute, and the value, and make sure it has proper opening and closing tags is kind of a pain and seems silly. I know how powerful regular expressions are but I'm not good at them and they frustrate me to no end. I think an example would get me started. Just a regex for finding tags like [b]bolded text[/b] and tags with attributes like the link
View 2 Replies
Dec 24, 2010
I need to use regular expressions in C# to validate a TextBox.
Regular expressions should NOT allowed
more that ONE space between words, considering also beginning and end of the string
UPDATE
I NEED to add this role in ValidationExpress for a Validation Control in ASP.NET
View 8 Replies
May 15, 2012
I applied regular expression validator on date of birth and Missing date for a missing person. the missing date should be greater than the date of birth . I applied compare vallidator but it is not working properly. it comparing day of date of birth with day of missing date, both months and years...
if i give...
date of birth: 2/2/1980
Missing date: 1/2/1981
it is giving the error message...
I applied this regular expression:
^((0?[13578]|10|12)(-|/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|/)((19)([2-9])(d{1})|(20)([01])(d{1})|([8901])(d{1}))|(0?[2469]|11)(-|/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|/)((19)([2-9])(d{1})|(20)([01])(d{1})|([8901])(d{1})))$
View 1 Replies
Mar 26, 2010
I am getting ready to just write my own, but I have a need for some regular expressions that will validate strings to make sure they are in an acceptable format to be inserted/updated into a database field. I figure it may just be to find a list of them someone has already posted somewhere and just use those.
View 3 Replies
Feb 21, 2011
I have a website created in asp.net and have the following fields displayed in the grid view linked through a database.First_Name Last_name City Username Password Email Mobile Genderplease let me how I can put validations when the edit button is clicked and the textboxs popout...I have tried a lot of ways like edit template and all but they have not been helpfulReallyIf you need I can also post the code I am using..
View 1 Replies
Aug 10, 2012
Code to read the span having the particular class name and assign to match collection.
I am having a set of html tags.
<span><a href="asb.aspx">Dummy</a></span>
<span class="active"><a href="abc.aspx">Hi thi is titile</a></span>
I need to get the span having the class name ="active".That is i need the result
<span class="active"><a href="abc.aspx">Hi thi is titile</a></span>
It will be fine if i get the text in the a tag that is with in the span having the class name "active".
View 1 Replies
Jan 25, 2011
I am trying to find a way to limit the inputs on a webpage to a variety of different sequences, and although I have worked through the regular expression library, I am still confused on how to allow decimal places and a maximum value. I initially used rangevalidators, but as you know, these only limit the inputs to a range, and have no control over the decimal places entered. A variety of limits i have been asked to implement are:
1. Range 0-45, 0 decimal places
2. Range 0-20, 2 decimal places
3. Range 16-65, 0 decimal places
4. Range 0-99, 2 decimal places
5. Range 0-1500000, 0 decimal places
6 Range 0-200, 1 decimal place
For 1 and 5 respectively, I have used
([0-9]|[0-9]d|45)$
([0-9]|[0-9]d|1500000)$
but want to be sure that I have understood the pattern correctly. How do I then go about creating a pattern for the other examples?
View 3 Replies
Sep 7, 2010
I have set up url rewriting in my web.config with regex rules and it works correct for all html files.
Problem:
[code]...
View 6 Replies
Apr 25, 2010
In the "Regular Expression Editor" dialog in VS 2008 ( or 2005 for this matter ) ,
there is a list of "standard expressions" like :
"French phone number" , "French postal code" etc..
And of course there is an option to select a "Custom" and then enter your own regular expression.
Well.. I want to add a predefined expressions to that list . Like : "Israeli phone number" .
I don't want to enter it every time by selecting a custom value .
I want my developers in the team available items for them to choose.
Anyone knows how to alter that list ?
I've found some question about it on the web - and the answer given is that it's not possible .
View 1 Replies
Nov 5, 2010
I'm struggling with a URL Rewriting rule for SiteFinity. I am trying to make sure that you can only access the homepage via / and not /default.aspx.
I tried the following rule:
<rule mode="PermanentRedirect">
<url>/default.aspx</url>
<rewrite>/</rewrite>
</rule>
Which actually works perfectly on the homepage - however it also catches /sitefinity/default.aspx and redirects off the homepage - not content editors!
I essentially need a rule that will match when there is nothing prior to the string /default.aspx.
View 2 Replies
Jan 21, 2010
I want to rewrite this Url www.xyz.com/products.aspx?id=1&product=acid for this i want regular expression.
View 11 Replies
Mar 23, 2010
How can I write regular expression in C# to validate that the input does not contain double spaces? I am using Regular Expression Validation. However I do not know what is the Validation Expression to get the result.
"white snake" : success
"white snake" : fail
View 4 Replies
Jan 4, 2011
I need a regular expression that only excepts numbers divisible by 1.5. I checked regex library and they have nothing on it.
View 4 Replies
Mar 6, 2013
i want a regular expression to validate path. THe path is :
Server.MapPath("../Error/Feedbackdoc/" & fid & ext)
& fid & ext is the file which is uploaded.
i want to validate the path i.e. ../Error/Feedbackdoc/ and rest can be name of uploaded file.
View 1 Replies
Feb 27, 2013
In my resiter form i want users to restrict them not to enter gmail yahoo ids, only company ids would be accepted..
View 1 Replies
Sep 30, 2010
I have a ListBox that contains userNames which is inputted by a user during run time. This number of items in the ListBox is dependent on the user's input. These userNames will then be used in a Lambda expression like this:
var vHandleResult = vHandleResult.Where(a => a.UserName.Contains("userName"));
This works fine when there is only 1 user in the ListBox but doesn't produce the correct results when there are multiple items in the listBox. I tried manually creating the expression which should be written as this:
var vHandleResult = vHandleResult.Where(a => a.UserName.Contains("userName1") || a.UserName.Contains("userName2") || a.UserName.Contains("userName3") || a.UserName.Contains("userName4"));
I tried forming the "a.UserName.Contains("userName") expression as a string which is dependent on the number of the items (using foreach) and then just plug in the resulting string in the expression but it seems that it doesnt accept string as an expression.
View 2 Replies