Python regular expressions
what is the regular expressions that will identify the class of valid NRIC numbers (inclusive of the ending alphabets) ...
what is the regular expressions that will identify the class of valid NRIC numbers (inclusive of the ending alphabets) ...
Possible Duplicate: Python regular expressions what is the regular expressions that will identify the class of valid NRIC numbers (inclusive of the ending alphabets) ...
There is a CKEditor field on our website which saves it's HTML to a text field in a MySQL database. What I'm wondering is, if there is a function (regex for example?) that could strip out HTML tags when doing a LIKE match, e.g. so that searching for: like '%this is a test%' would find 'this<strong>is</strong>a test I get the feel...
I need some help writing a regular expression that matches this: an opening square bracket OR number as first character a closing square bracket (if there was an opening square bracket) OR number (if the opening was a number) as the last character at least one comma separating two numbers without a space, and if there are more commas, ...
Language = C#.NET Anything that is between [STX] and [ETX] must be accepted rest of the things must be rejected. string startparam = "[STX]"; string endparam = "[ETX]"; String str1 = "[STX]some string 1[ETX]"; //Option 1 String str2 = "sajksajsk [STX]some string 2 [ETX] saksla"; //Option 2 String str3 = "[ETX] dksldkls [STX]some stri...
Hello, I want to match a separate word which starts with # character. enter #code here - #code some#string here - nothing #test - #test I came up with following regex: "enter #code here".replace(/\b#[\w]*/gi, "REPLACED") But it doesn't work. After some testing i found that "enter #code here".replace(/#\b[\w]*/gi, "REPLACE...
Hello, I have following HTML markup, <div id="subcontent_l"> <p> <a href="/membership-packages/"><img height="202" width="644" alt="" src="http://74.52.72.231/wp-content/uploads/2010/06/banner1.jpg" title="banner1" class="aligncenter size-full wp-image-299"> </a> </p> <p class="subc">Access to Guaranteed Healthcare Benefits</p> <p><a h...
Currently I'm trying to parse some html and return an array with the values inside each element. For example: if I pass the below markup into a function var element = "td"; var html = "<tr><td>1</td><td>2</td></tr>"; return Regex.Split(html, string.Format("<{0}*.>(.*?)</{0}>", element)); And I'm expecting back an array[] { 1, 2 } W...
I've got a string that contains multiple substrings, each of which contains one or more 'E' character. I am trying to get the coordinates of each of these sustrings using Perl and regex. Here is what I tried at first. #!/usr/bin/perl use strict; my $str = "GGGFFEEIIEIIIIEEEIIIETTGGG"; foreach my $match($str =~ m/(E+)/) { print "match...
I have some HTML and want to replace the "src" attributes of all the img tags so that they point to copies of the identical images (although with different file names) on another host. So for instance, given these three tags <IMG SRC="../graphics/pumpkin.gif" ALT="pumpkin"> <IMG BORDER="5" SRC="redball.gif" ALT="*"> <img alt="cool ima...
I'm trying to match and break up a typical tv torrent's title: MyTV.Show.S09E01.HDTV.XviD MyTV.Show.S10E02.HDTV.XviD MyTV.Show.901.HDTV.XviD MyTV.Show.1102.HDTV.XviD I'm trying to break these strings up into 3 capture groups for each entry: Title, Season, Episode. I can handle the first 2 easy enough: ^([a-zA-Z0-9.]*)\.S([...
I want to write a regex to match on a string and ignore white spaces. For example, a search for 'foobar' would match on 'foo bar'. ...
Hi there. I have to use tinymce as a wysiwyg editor in a CMS to populate a flash app. I need to strip out the modern HTML in favor of something flash can use. Here's what I'm trying: var initUnderline:RegExp = new RegExp('<span style="text-decoration: underline;">', "gi"); var endUnderline:RegExp = new RegExp("</span>", "gi"); var strin...
Hello, Currently i have a input box which will detect the url and parse the data. So right now, i am using var urlR = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+) (?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; var url= content.match(urlR); problem is, when i enter url like www.google.com, its not working, whe...
I would like to be be able to use a regular expression in PHP to be able to extract the value of "Ruby9" from the following html snippet on Red Hot Ruby Jewelry<br>Code: Ruby9<br> Sometimes the "Code" will be alphanumeric,numeric, or just letters. Any advice would be much appreciated Thanks! ...
Basically I need some text like: I have an ice cream cone. You are in trouble. You need a bath. And change it from 1st or 2nd person to 3rd person. He has an ice cream cone. He is in trouble. He needs a bath. I've started a js app, but it's super simple at the moment. Before I waste time reinventing the wheel, I figured I'd ask:...
I want to develope the valid xhtml doc the input doc is not well formatted i managed to correct some errors but stuck up in condition like <span>......<p></span>...</p> there can be any tags in place of span and p......but condition is as mentioned i want to handle this condition i m new in .net c# plz do the needful.... thanx. ...
Hi Can anyone suggest me some way of finding and parsing dates (in any format, "Aug06", "Aug2006", "August 2 2008", "19th August 2006", "08-06", "01-08-06") in the python. I came across this question, but it is in perl... http://stackoverflow.com/questions/3445358/extract-inconsistently-formatted-date-from-string-date-parsing-nlp Any ...
i have following pattern parts=/a,1mb,/b/c,2gb,/zee/last,-1 #general form on next line ^parts=path1,size1,...,lastPath,-1$ I want to replace all $path1,$size1 except $lastplace,-1 with $newPath,$newSize i.e. parts_new=/p,2mb,/q/r,5gb,/zee/last,-1 #general on next line ^parts=newPathX,newSizeX,lastPath,-1$ I figured how to do it usi...
I need a solution to this situation please. Situation is a string that results in something like this: <p>This is some text and here is a <strong>bold text then the post stop here....</p> Because the function returns a teaser (summary) of the text, it stops after certain words. Where in this case the tag strong is not closed. But the...