regex

javascript plain text url parsing

I'm trying to search plain old strings for urls that begin with http, but all the regex I find doesn't seem to work in javascript nor can I seem to find an example of this in javascript. This is the one I'm trying to use from here and here: var test = /\b(?:(?:https?|ftp|file)://www\.|ftp\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*[A-Z0-9+&@#/%=~_|$]...

Get text within div.

<div class="plugin-block"> <h3><a href="http://wordpress.org/extend/plugins/sailthru-triggermail/"&gt;Sailthru&lt;/a&gt;&lt;/h3&gt; **Intergrate Sailthru API functionality into your WordPress blog.** <ul class="plugin-meta"> <li><span class="info-marker">Version</span> 1.0</li> <li><span class="info-marker">Updated</span> 20...

linux + find mechanism with Irregular Expression (find command) or perl

hi dear friends and good morning The following question may be complicated and critical for my systems I have 4 Linux machines with cluster My target is to find all kind of IP address (xxx.xxx.xxx.xxx) in every file in the linux system remark: need to scan each file in the linux system and verify if the file include IP address if ye...

How can I return only numbers and white space in Regular Expression?

Hi guys, I would like to have a regular expression which returns only the numbers and the white space which I've inserted. i.e. 012 345 678 or 012 345 678 910. Any suggestion please? ...

how can I check the input is only number and white space in regular expression?

I have "222 22 222", "333 33 33 333", "1234/34", and "ab345 543" and I want to check whether these inputs are numeric and white space. I.E this case, the first and the second inputs should return True by using method Test of Regular Expression, or return its own value by using Exec method. The third and the fourth should return false. Ho...

Regular Expressions Exclude From a class

I'm building a dynamic code generator and using regular expressions. Given this block of text ##Properties public #PropertyType# #NewProperty# { get; set; } ## ##Events public event #EventName#-...

is there any way to make my jquery search better ?

Hello var myarr= Array('test1','test2','test3'); var searchTerm = "test"; var rSearchTerm = new RegExp( searchTerm,'i'); $.each(myarr, function(i) { if (myarr[i].match(rSearchTerm)) { //item found } });​ guys is there any way to make my search algorithm better ? "myarr" will be a big array so i want...

regular expression for validating currency entered in a text Input in flex3

hi all, i have a text input box for entering the currency. it shud allow user to enter numbers from [0-9] and a . operator tht i did it. now it shud allow 1 to 3(1 or 2 or 3) digits before decimal and 2digits after decimal. the range is betweem 0.00 to 999.99 how can i achieve this in flex3. if user entered 3 digits he shud not b able...

Is there any other way for email validation in .net?

I'm using a form which ask for email address. I used regular expression for it as .*@.*\..* But it is not working fine for some of my test email id like dsrasdf@@@[email protected] Any one provide me regular expression for the email validation in asp.net or can i use any other method for it. Please give your suggestions. ...

regex for alphanumeric, but at least 6 character

Hi, I need regex for asp.net application. regex for only alphanumeric, but at least 6 character. Thanks ...

Does "Find-Replace whole word only" exist in python?

Does "Find-Replace whole word only" exist in python? e.g. "old string oldstring boldstring bold" if i want to replace 'old' with 'new', new string should look like, "new string oldstring boldstring bold" can somebody help me? ...

Removing unclosed opening <p>tags from xhtml document

I have a big xhtml document with lots of tags. I have observed that a few unclosed opening paragraph tags are repeating unnecessarily and I want to remove them or replace them with blank space. i just want to code to identify unclosed paragraph tags and delete them. Here's a small sample to show what I mean: <p><strong>Company Registra...

Regular Expression to check the spaces and minimum entries in C#

hi Guys, I am using c# for programming! I want to write one regular expression in c# which will check first and last space in a sentence and will allow spaces in between it as well as there should be minimumm 2 charater entry in field, no limit for maximum characters, no special keys are allowed (@,#,$ etc) characters allowed Please s...

PHP preg_match() Unknown Error

I am currently trying to process a csv file in PHP using preg_match(). An example of the data that I am trying to process is below; "SN120187","Aldersr Rd Nr Shops","","STHPTN","50 56.4241N","1 25.7587W","1001077307","2010-05-30 15:29:49","10","","SURRSHLT3x32","BSU243L1","iiipiiipiiipiiipiii", "HA035028","Hursley Road - Leigh H...

How to translate "Lorem 3 ipsum dolor sit amet" into SEO friendly "Lorem-3-ipsum-dolor-sit-amet" in Java?

In my blog app, a user can enter any text as a title for their entry and then I generate a URL based on the text. I validate their title to make sure it only contains letters and numbers. If they enter something like Lorem 3 ipsum dolor sit amet how could I generate the more SEO friendly version of this text: Lorem-3-ipsum-dolor...

Extracting everything but tags from a web page without a parser - using scanner and regex?

Working on Android SDK, it's Java minus some things. I have a solution that pulls out two regex patterns from web pages. The problems I'm having is that it's finding things inside HTML tags. I tried jTidy, but it was just too slow on the Android. Not sure why but my Scanner regex match solution whips it many times over. currently, I g...

Regex to reduce the spaces in a file by 1

I've a file and I want to make the following changes in it: Replace n consecutive spaces by n-1 spaces. Example: Input: a b c e fg j ij k Output: ab c e fgj ijk How do I do it? ...

How can I do a case Insensitive String.Replace in c#?

Possible Duplicate: Is there an alternative to string.Replace that is case-insensitive? I need to find and replace a string and ignore the case in c#. What is the best way I can accomplish this? Regex? ...

Java regex lazy operator not so lazy ?

I have Java class that have to fetch the content of an URL online (returning an XML), and apply a regexp over it (the behaviour is defined by third-party files, I so cannot use DOM or SAX to parse the response). Here is the code : import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import ...

Regular expression

Is there reason following should not work in via .Net but works in RegexBuddy? String: formatter:'number',formatoptions:{decimalSeparator:'.',decimalPlaces:2,defaulValue:0} Expression pattern: [a-zA-Z]+:({)??([a-zA-Z]+[:](')??[a-zA-Z0-9.,]+(?(3)'|,?),?)+(?(1)}|.) Produces matches within regex buddy but fail within .net. private s...