regex

Regular Expression - Range (2-16)??

All i want to do is match a number between 2-16, spanning 1 digit to 2 digits according to http://www.regular-expressions.info/numericranges.html, they have examples for 1 or 2 digit ranges, but not something that spans both..if that makes sense. The regex [0-9] matches single-digit numbers 0 to 9. [1-9][0-9] matches double-digit numbe...

How to extract the webkit transformation syntax in Javascript

Hi all! I would like to extract the individual elements of a composite webkit transformation in Javascript. For example: var act_transform = element.style.webkitTransform gives me: scale(0.6) translate(0px, 2236px) rotate(12deg) What is good human readable, but terrible to parse programmatically. I'm interested on all 4 numerical ...

MySQL regex at runtime

SELECT telephone_number FROM table WHERE telephone_number REGEXP '^1[() -]*999[() -]*999[() -]*9999$'; how do i make so its valid for any number format and any number like 407-888-0909 1(408)998-7654 7776654433 876-7788 right now its only valid for 1-999-999-9999 ...

Convert eregi to preg_match - what is Unknown modifier 'F'?

Trying to convert the following two eregi statements to their preg counterparts: eregi("/F \(([^)]*)\)",$In,$DataOut); eregi("/T \(([^)]*)\) /V \(([^)]*)\)",$In,$DataOut); So I tried adding in delimiters: preg_match("//F \(([^)]*)\)/",$In,$DataOut); Unfortunately this does not work and produces Unknown modifier errors. Can I get h...

Search string for substring

I need to search a large string for a particular substring. The substring will start with Testing= but everything within the double quotes could be different because its a user login. So examples of the substring I need are Testing="network\smithj" or Testing="network\rodgersm" Do my requirements make sense? How can I do...

Javascript REGEX: How to get youtube video id from URL?

I want to get the v=id from youtube's URL with javascript(no jquery, pure javascript); Example Youtube URL formats: http://www.youtube.com/watch?v=u8nQa1cJyX8&a=GxdCwVVULXctT2lYDEPllDR0LRTutYfW http://www.youtube.com/watch?v=u8nQa1cJyX8 or any other youtube format what contains a video id in the url Result from these formats ...

mySQL regex in the where clause

SELECT telephone_number FROM table WHERE telephone_number REGEXP '^1[() -]*999[() -]*999[() -]*9999$'; how do i make so its valid for any number format and any number like 407-888-0909 1(408)998-7654 7776654433 876-7788 right now its only valid for 1-999-999-9999 ...

Regex to extracting links from HTML

Possible Duplicate: Extract text and links from HTML using Regular Expressions Given an string containing HTML such as: <td scope="row">1</td> <td scope="row"></td> <td scope="row"><a href="/Archives/directory.htm">directoryfile.htm</a></td> <td scope="row">directoryfile</td> <td sc...

Perl RegEx for Matching 11 column File

...

When validating a form via jquery, ensure field contains at least one letter...

So, I suck terribly at regex and javascript. As such, when I realized I needed to validate a form field via jquery to ensure that at least one alpha character was used, I decided to ask you fine folks for some help. I want to allow user to use apostrophes, spaces, dashes, periods, underscores, and alphanumeric chars in this field. The...

Cannot import android.text.util.Regex? Where is it?

I'm developing an application and I want to use android.text.util.Regex.WEB_URL_PATTERN as the pattern for the Linkify. But, as I have notice, I cannot import android.text.util.Regex for some reason. Why so? Is there a way to workaround this? ...

How to strip leading and trailing quote from string, in Ruby

I want to strip leading and trailing quotes, in Ruby, from a string. The quote character will occur 0 or 1 time. For example, all of the following should be converted to foo,bar: "foo,bar" "foo,bar foo,bar" foo,bar ...

How to validate the URL using regex in Java?

I need to check if an URL is valid or not. The URL should contain some subdirectories like as: example.com/test/test1/example/a.html The URL should contain subdirectories test, test1 and example. How can I check if the URL is valid using regex in Java? ...

twitter regular expressions

I need 3 different regular expressions one that finds at the beginning of the string a 'D' and a space then a name, so 'D patrickgates hello there' would return 'D patrickgates', or if all possible would return just 'patrickgates' one that will find the @ sign and a name together anywhere in the string so '@patrickgates hello, world' w...

regexp that selects only the capital letter from another regexp

I have this type of text: !D este caro 1 C este descgiderea C1 este alta deschidere Deschiderea de 1C este cu 2C 2D 3 D 1NT 2D 123456P This easy regexp: /([0-9][CDHS])/g selects "1C","2C","2D","2D" (a digit immediately followed by [CDHS], anywhere in the text) . What I want is to select only the letter from the sequences above...

Regular Expression which check the number of characters

I have to write a .NET Regular Expression which validates if a string is alpha-numeric and has 4 or 8 characters (nothing less, nothing more). How can I do that? I tried with ([a-zA-Z0-9]{4})|([a-zA-Z0-9]{8}) but it doesn't work. ...

url regex issues

I'm using this regex (((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&amp;%\$#\=~_\-]+))* to search for urls, the only problem, is it's finding "you ca" is a url, how do I change it so there HAS to be a period before the ending (in this ...

PHP: Find and exctract into an array all instances of specific text in a string.

Hi All, I have a string that contains several "placeholders" in it, and each placeholder is marked with this syntax: {value}. I want to be able to pull out each placeholder within the string and load them into an array. For example, if I had this string here... "this is a {test} string, to demonstrate my {objective}." I would want t...

remove carriage return only inside the span with regexp

I have this piece of text in a string: <p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"><i style=""><span style="" lang="ES-TRAD">some text another text<o:p></o:p></span></i></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" al...

Regular expression to find occurrence of uppercase followed by lowercase

Hi, I'm fairly new to Regex. Hoping someone would help me find a regular expression for finding occurrences of uppercase followed by lowercase. For example: ABcDe Here I would be hoping to find the 'B' and the 'D' Thanks! ...