regex

Extract absolute path operation from SVG data value

I have the following d attribute for SVG but the question is about regular expression : M772.333,347.86c0,2.284-1.652,4.14-3.689,4.14h-52.622c-2.038,0-3.69-1.854-3.69-4.14V296.139c0-2.286,15.652-1.14,17.69-1.14l-0.189-3h38.81c2.039,0-0.31,4.854-0.31,7.14L772.333,347.86z I'm looking for a way to get the blocks that has capital and a ser...

PHP email validation

For PHP what is the best email validation using preg, NOT ereg because it's deprecated/removed. I don't need to check if the website exists (it's not like maximum security). I've found many ways with ereg but they (obviously) aren't good practice. ...

regular expression extract string between two strings

Hi all, I am trying to extract strings using regexp. For example in the following string: select DESCENDANTS([Customer].[Yearly Income],,LEAVES) on axis(0), DESCENDANTS([Sales Territory].[Sales Territory],,LEAVES) on axis(1), DESCENDANTS([Customer].[Total Children],,LEAVES) on axis(2) from [Adventure Works] where [Meas...

Need help with regex Email in Notepad++

I have a list with contacts each line, we have to replace the whole line in to single email: Name, Surname, Address, Email, Phone => Email I know how to find email, but I need smth like find and replace to "" everything but Email ...

How to use the rails match method with a string?

Is there a way to use the rails match method with a simple string, rather than a regular expression? I'm trying to match a url as such sometext.match('http://www.example.com') The problem is, this is stil getting evaluated as a regular expression, so I have to escape all the special characters for this to work properly, as such: some...

Why is my code stopping?

Hey I've encountered an issue where my program stops iterating through the file at the 57802 record for some reason I cannot figure out. I put a heartbeat section in so I would be able to see which line it is on and it helped but now I am stuck as to why it stops here. I thought it was a memory issue but I just ran it on my 6GB memory ...

javascript regex for validating email list with ASP MVC 2 data annotations

I am trying to use ASP MVC 2 data annotations to validate a semicolon delimited list of email addresses on the client side. The regex below works on the server side but doesn't work with the javascript because javascript regular expressions don't support conditionals. "^([A-Za-z0-9_\+\-]+(\.[A-Za-z0-9_\+\-]+)@[A-Za-z0-9-]+(\.[A-Za-...

How do I search for words that begins and ends with other words from the same array?

I have a long list of words in an array. Some short, some long. I'd like to filter out those words which starts with a word from the array (length of this "prefix" word can be set to, say, 3 characters) and which at the same time ends with a word from it. Let's say the first word is 'carport'. Now, if 'car' and 'port' exist in the array...

Replicate the functionality of Java's "Pattern.quote" in a JavaScript RegExp

In Java, you might try to make a regular expression that would match the URL stackoverflow.com using Pattern.compile("stackoverflow.com"). But this would be wrong because the . has special meaning in regular expressions. The easiest way to fix this is to write Pattern.compile(Pattern.quote("stackoverflow.com")) which comes out to: Patter...

.NET Regular Expression: Get paragraphs

I'm trying to get paragraphs from a string in C# with Regular Expressions. By paragraphs; I mean string blocks ending with double or more \r\n. (NOT HTML paragraphs <p>)... Here is a sample text: For example this is a paragraph with a carriage return here and a new line here. At this point, second paragraph starts. A paragraph en...

Remove content from a wordpress.com feed using yahoo pipes

Hello, I am using yahoo pipes to get content matching a certian category from my WordPress.com Blog. Everything is working fine but WordPress adds "share" links to the bottom of the feed that I would like to remove. Here is what's being added: <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/bandonran...

Regex matching HTML option tags which are unselected and also selected

Can some recommend a regex to return the value when an item is selected as well as unselected as seen below. <option value="32_1002_ACCT1001" selected="selected">ACCT1001 -- Accounting 1a</option> <option value="32_1002_ACCT1002">ACCT1002 -- Accounting 1b</option> My regex currently works only for the unselected option seen below. (<...

jQuery: replace() or wrap() http://name.tld/request_url?parameter with <a href="this">...</a> ?

Ist there any better way to replace/wrap the h*tp://name.tld/request_url?parameter or h*tps://name.tld/request_url?parameter text in some certain html elements with an <a href> HTML <div id="posts"> <div class="post"> Tweet text 1 http://google.com and other text. </div> <div class="post"> Tweet text 2 https://www.google...

Plus signs being replaced for %252520

When I click on my index'd pages in Google the plus signs in my query string are being replaced (encoded?) for %252520. Anyone know why? Example: lovelakedistrict.com/result/?q=Private%252520car%252520park&page=2 should be lovelakedistrict.com/result/?q=Private+car+park&page=2 I have heard that this is a result of redirecting my ...

Regex - Only letters?

Could somebody help me create a regex that matches only characters? Thanks in advance! ...

If timer is started and running , donot reset it once again using flex3

I'm having 2 problems. 1 - I have a text area in which I am matching a string. If it matches then a timer will start. But that condition will likely be satisfied more than once, so I would like to give a condition that if timer is already running don't do anything, if(!timer.running) then start timer. But it still resets the timer ever...

python: regular expressions, how to match a string of undefind length which has a structure and finishes with a specific group

Hi, I need to create a regexp to match strings like this 999-123-222-...-22 The string can be finished by &Ns=(any number) or without this... So valid strings for me are 999-123-222-...-22 999-123-222-...-22&Ns=12 999-123-222-...-22&Ns=12 And following are not valid: 999-123-222-...-22&N=1 I have tried testing it several hours alr...

Parse a CSS file with PHP

I want to parse (in a special way) a CSS file with PHP. Example: cssfile.css: #stuff { background-color: red; } #content.postclass-subcontent { background-color: red; } #content2.postclass-subcontent2 { background-color: red; } And I want that PHP returns me each class name that have the postclass in its name. The res...

sed + match the first word in line and the second word that begin with abc

How to match all lines that begins with word ADDRESS and the second string start with abc characters. remark - ( I need to combine the sed syntax in my shell script) for example more file ADDRESS abc1a (match) ADDRESS abc1b (match) ADDRESS acb1a (will not match) ADRESS abc (will not match) ADDRESS abc2a (will match) ADDRE...

How to strip tags in PHP using regex?

$string = 'text <span style="color:#f09;">text</span> <span class="data" data-url="http://www.google.com"&gt;google.com&lt;/span&gt; text <span class="data" data-url="http://www.yahoo.com"&gt;yahoo.com&lt;/span&gt; text.'; What I want to do is get the data-url from all spans with the class data. So, it should output: $string = 'text <...