regex

How to write a function with Oracle regexp to test a domaine name ?

I would like to write a PLSQL function that returns true if the domain name I pass is valid. I should use regular expression, but I don't know how to do this. declare ignore boolean; begin isDomainSyntaxOk('www.laclasse.com'); --> should return true. isDomainSyntaxOk('www.la classe.com'); --> should return false because ...

ASP.NET UrlRewriter - How to Write RegEx for Root?

Hi All, I have been trying to use UrlRewriter (Intelligencia.UrlRewriter.dll) in a test project. My rewrite statement is as in the following: <rewrite url="~/Sample/(.+)" to="~/Sample.aspx?Test=$1"/> This statement works great for a URL like: http://localhost:4188/RewriteTest/Sample/12345 or, let's say: http://RewriteTest.com/Sa...

Extracting recurrent group information from a java Matcher object; Want ALL values inside group, instead of last only.

Hello! I'm having some problems with a regular expression.. the thing is: consider the following html: <form> <input name="methodIndex" value="0" type="hidden"> <hr align="left" width="80"> <h4>java.lang.String methodName()</h4> <p>Operation exposed for management</p> <table border="1" cellpadding="2" cellspacing="2"> <tbody> ...

IE7 regex issue - Regex that work in every browser does not work in ie7

I have a regex validating a password value to be > 6 < 25 characters with at least one number. var passwordRegEx = /^(?=.*\d)(?=.*[a-zA-Z]).{6,25}$/; if(!#quickRegister_Password').val().test(pass)) { errorMgs += 'Your password must be at least 6 characters and have at least 1 number and 1 letter.\r\n'; } It works in Firefox, Chrome...

Regular Expression in exactly this form : Tyler Durden

Hi i need a javascript regex for a name field in my html form. The user should be able to enter multiple names seperated with space. And first character of all names should be a capital. No numbers, special chars. etc. thank you. ...

How to parse word-created special chars in java

I am trying to parse some word documents in java. Some of the values are things like a date range and instead of showing up like Startdate - endDate I am getting some funky characters like so StartDate ΓÇô EndDate This is where word puts in a special character hypen. Can you search for these characters and replace them with a regular ...

How to extract data from the following using RegEx?

I have a data set in the following pattern 1<a href="/contact/">Joe</a><br />[email protected]</div> 2<a href="/contact/">Tom</a><br />[email protected]</div> 3<a href="/contact/">Jerry</a><br />[email protected]</div> So on... I need to extract the name and email id alone from it. How do I do it? Update: Based on your res...

Getting a tagged result with a regular expression

What would be a basic regular expression which finds some string if given the string quuz="bleh" foo="some string" bar="some other string" where some string and some other string are arbitrary strings. ...

RegEx expression that will capture everything between two characters including multiline blocks

I want to capture all text & blocks of text between <% and %>. For example: <html> <head> <title>Title Here</title> </head> <body> <% include("/path/to/include") %> <h1>Test Template</h1> <p>Variable: <% print(second_var) %></p> <% variable = value; foreach(params here) { code here } %> <p><a href="/" title="Home">Home</a></p> <...

ruby regex split difficulties, close but not quite

I am having quite the difficulty using regex in ruby to split a string along several delimiters these delimiters are: , / & and each of these delimiters can have any amount of white space on either side of the delimiter but each item can contain a valid space. a great example that I've been testing against is the string 1, 2 /3 and...

php regex to get string inside href tag

I need a regex that will give me the string inside an href tag and inside the quotes also. For example i need to extract theurltoget.com in the following: <a href="theurltoget.com">URL</a> Additionally, I only want the base url part. I.e. from http://www.mydomain.com/page.html i only want http://www.mydomain.com/ ...

How to break queries using regex in php

Suppose I have the following string: insert into table values ('text1;'); insert into table values ('text2') How do I break those queries (get each individual query) using regular expressions? I've found a very similar problem: http://stackoverflow.com/questions/958095/useregex-to-find-specific-string-not-in-html-tag ...but it uses...

Python Regular Expression Matching: ## ##

Im searching a file line by line for the occurrence of ##random_string##. It works except for the case of multiple #... pattern='##(.*?)##' prog=re.compile(pattern) string='lala ###hey## there' result=prog.search(string) print re.sub(result.group(1), 'FOUND', string) Desired Output: "lala #FOUND there" Instead I get the following...

Regular Expression in gVim to Remove Duplicate Domains from a List

I need a regular expression written to use in gVim that will remove duplicate domains from a list of URLs (gVim can be downloaded here: http://www.vim.org/download.php I have a list of over 6,000,000 URLs in a .txt file (which opens in gVim for editing). The URLs are in this format: http://www.example.com/some-url.php http://example2...

Python Regular Expression Matching, help please!

Possible Duplicate: Python Regular Expression Matching: ## ## I already asked this question, but let me restate it better... Im searching a file line by line for the occurrence of ##random_string##. It works except for the case of multiple #... pattern='##(.*?)##' prog=re.compile(pattern) string='lala ###hey## there' result=...

RegEx exclude sub-group text from being included in a parent sub-group

Hello everyone. For the sake of this question, I'll include a basic example of what I'm trying to do. I have been looking for a method using regex which would allow me to have an input such as this: <a>$4<br>.00</a> To match this in one sub-group 4.00 I have tried numerous methods, all being around the lines of: <a>\$([0-9]+<br>\.[0...

.NET regex multiline help - regular expression

I've got a multiline string like this. Ity has line feeds. [Site Url="http://medportal.domain.edu" Owner="DOMAIN\user1" SecondaryOwner="DOMAIN\user2" ContentDatabase="WSS_Content_$1" StorageUsedMB="0.8" StorageWarningMB="0" StorageMaxMB="0" /] [Site Url="http://medportal.domain.edu/sites/ahSC" Owner="DOMAIN\user1" ContentDatabase="WSS...

Using $0 in Javascript's String.replace

I'm highlighting instances of a search string within a set of text. I want to preserve the case of the original text while replacing a case-insensitive match of the query. Here's what I started with: text.replace(new RegExp('(' + query + ')', 'ig'), '<em>$1</em>'); In this case, I'd need to escape query to prevent parentheses from bre...

What's the best way to apply many Perl regular expression tests?

I have a Perl module that matches text against a list of hundreds of regexes; currently I am just or'ing them: if ( /?:re1/ or ... /re200$/ ) { return "blah"; } Is there a better/faster/less resource-intensive way to do this? Perhaps a useful module exists, or I should store them in a hash, etc. ...

How to Remove Duplicate Domains from a Large List of URLs? RegEx or Otherwise

I originally asked this question: http://stackoverflow.com/questions/4002115/regular-expression-in-gvim-to-remove-duplicate-domains-from-a-list However, I realize I may be more likely to find a working solution if I "broaden my scope" in terms of what solution I'm willing to accept. So, I'll rephrase my question & maybe I'll get a bett...