269 Topics

Member Avatar for
Member Avatar for theharshest

I am using the following code to extract second name from the html having following kind of lines - <tr align="right"><td>3</td><td>Matthew</td><td>Brittany</td> So, I want to extract "Brittany" from the above line [CODE]for line in f: match3 = re.search(r'$([a-zA-Z]+)(</td>)',line) if match3: print match3.group(1)[/CODE] But this ain't working. Please help.

Member Avatar for Gribouillis
0
443
Member Avatar for knan

<text> <p><s id="s1"><ng><w pws="yes" id="w1" p="CD">25</w> <w l="woman" pws="yes" id="w4" p="NNP" common="true" headn="yes">Woman</w></ng> <vg tense="past" voice="act" asp="simple" modal="no"><w l="create" pws="yes" id="w10" p="VBD" headv="yes">created</w></vg> <pg><w pws="yes" id="w18" p="IN">for</w></pg> <ng><w vstem="succeed" l="success" pws="yes" id="w22" p="NN" headn="yes">success</w> <w l="barbie" pws="yes" id="w30" p="NN" headn="yes">barbie</w></ng> <ng><enamex type="location"><w l="reynold" pws="yes" id="w37" p="NNP" locname="single">Reynolds</w></enamex> <w l="sep" pws="yes" …

Member Avatar for snippsat
0
220
Member Avatar for DILO3D

i have a following text in a file: host1 menu=gateway title=gateway host=192.168.0.1 host2 menu=xgateway title=xgateway host=192.168.0.2 host3 menu=ygateway title=ygateway host=192.168.0.3 I have to match the 3 lines folowing by "host2" . these lines need to be matched. host2 menu=xgateway title=xgateway host=192.168.0.2 I used this codes.But its not complete. Can anyone …

Member Avatar for ko ko
0
88
Member Avatar for pythonnoobie

I need to find a pattern of kind APP[a-z][a-z][0-9][0-9][0-9] in the body of HTML and then replace them with hyperlinks. I am using Beautiful Soup to replace as I am dealing with HTML content. For Eg: APPsd222 to [URL="http://www.dani.com/APPsd222"]APPsd222[/URL] APPfd333 to [URL="http://www.dani.com/APPfd333"]APPsd333[/URL] If you are not aware about Beautiful Soup, …

Member Avatar for pythonnoobie
0
217
Member Avatar for cjohnweb

Hello! I've come across a little problem with Regex, I was hoping someone might see the problem off hand. Here is some sample content I am searching through, It's the gameshark codes for PEC: [code] #Ace Combat 3 Electrosphere#SLPS-02021#SLPS-02020 §N Joker Command D00BF32E ???? "Infinite Time for battle D0054332 2442 …

Member Avatar for cjohnweb
0
114
Member Avatar for QuesoTaco

I am studying viruses and trying to figure out how the FLEX module works for C++. I have taken classes before on regular languages, context free, etc. Is FLEX dealing with regular languages or regular expressions, and also what is the difference exactly? Could you give an example of how …

Member Avatar for gusano79
0
230
Member Avatar for QuesoTaco

I am trying to get consecutive words in a document using flex. Normally the forward slash should work, but for some reason it is not. Also I need to account for spaces. So I can't seem to use that regex character for this, how do I account for consecutive words …

0
132
Member Avatar for scarlettmoon

Working with javascript / jquery - Need to have a more precise regex for the following pattern: Should I have the ignore case included? If so where? X25b777s44K The regex I have: ^([A-Z]?)(\d{2})([a-z]?)(\d{3})([a-z]?)(\d{2})([A-Z]?)$ Thank you for your help.

Member Avatar for scarlettmoon
0
159
Member Avatar for ssreevidya.m

hai, I want an expression for all alphabets and some special characters like . - ' etc. I use an expression like ^[-_'.,A-Za-z]* but it doesnt contain '. can i get a correct expression for this. Thanks in advance Sreevidya

Member Avatar for shakeb@techwave
0
135
Member Avatar for diafol

Hi all, preg-Replace has stumped me again. I'm just too thick to get it. This is my problem: I have two files. File 'newvalues.php' with an array like so: [CODE].... $lang['this_key'] => 'blah blah blah'; $lang['another_key'] => 'rhubarb rhubarb'; $lang['something_else_key'] => 'twitter twitter'; ....[/CODE] And another file: 'template.php' like so: …

Member Avatar for diafol
0
157
Member Avatar for swinchen

I am working on a project that requires me to clean data from a series of RS-232 instruments. These instruments can have a different version number, and output format (both of which can change the expected ouput). On top of that there are flags that determine if certain fields are …

0
135
Member Avatar for umesh314

Hi all , i have a string var containing info like this. [B]STRING[/B] = "Are you posting in the most appropriate place [B][COLOR="Red"]PKG0620_REL_23_Nov_2010[/COLOR][/B] to receive relevant replies" So, my program will ask only "PKG0620" info to be given by the user which i am storing in SEARCH var. SEARCH = …

Member Avatar for umesh314
0
126
Member Avatar for liamfriel

Hello all, I am trying to use more regex but I can't seem to get this to work. The aim is to check inputs for either [url, [link or <a href: [CODE] $islink = false; foreach($_POST as $k => $v){ if((preg_match("/[url|[link|<a href/i", $v)) > 0 ){ $islink = true; } …

Member Avatar for liamfriel
0
161
Member Avatar for joomphp

hi! i have some html code like this [CODE] The Chihuahua Desert <a href="index.php">Dirt</a> Fest is <a href="/index.php">coming <a/>up, next February 17-19. <a href="http://google.com">Three</a>[/CODE] i want to replace /index.php with [url]http://google.com[/url] and index.php with [url]http://google.com/[/url] and idea how can i do this

Member Avatar for pritaeas
0
183
Member Avatar for linezero

I am trying to move a match from a match collection to another listbox as string. here is my regex code [CODE]Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://localhost/pos/leftpanel.html") Dim response As System.Net.HttpWebResponse = request.GetResponse Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim rssourcecode As String = sr.ReadToEnd Dim r As New …

Member Avatar for codeorder
1
294
Member Avatar for RoyalElite96

Hello everyone. I am working on this forum/post/script type thing. What I want to do is convert this example to HTML. [div] [p]Some text[/] [div] Some more text [/] [/] ---> <div> <p>Some text</p> <div> Some more text </div> </div> I don't want to use [/div] or [/p] to keep …

Member Avatar for kekkaishi
0
107
Member Avatar for ofir0803

Hi i have this string: [CODE]<div class="col-price"> <h4>you save</h4> <span ><span class="currency">$</span>32</span> </div> <div class="col-price"> <h4>discount</h4> <span >52%<span class="persent"></span></span> </div> <div class="col-price last"> <h4>original price</h4> <span ><span class="currency">$</span>62</span> </div>[/CODE] i want to be able to find the values of: [I]you save[/I], [I]discount[/I] and [I]original price[/I]. the desierd output: 32, 52, …

Member Avatar for kekkaishi
0
140
Member Avatar for perlnoob

Sample content of the file [CODE] PP: Happy Sunday! PP: It's a good weather. PP: Have a blessed Sunday everyone. the output should be HL: Happy Sunday! PP: It's a good weather. PP: Have a blessed Sunday everyone [/CODE] My code to generate that [CODE] $length=@fileinput; if($line=~/PP:\s/) { {if($j<$length) {if($line[$j-1]!~/PP:\s/ …

Member Avatar for d5e5
0
118
Member Avatar for lobstar

Hi, I am using cURL to grab the contents of a webpage which contains a table. I am trying to make an array out of the table contents, with the column headings as the array keys. Unfortunately the first row of the table, before the headers, has pagination which is …

Member Avatar for lobstar
0
463
Member Avatar for Perl_enthusiast

Hello everyone who reads this. I am currently creating a program in which the user inputs a booking reference which will allow them to overview flight details that they have added to previosu flights. I have been having trouble working out which direction I should follow to sort out this …

Member Avatar for Perl_enthusiast
0
956
Member Avatar for danholding

please bare with me as im a returning newbie and have not really used re.expression much and still get very confused! my problem! i am currently working on a few database records which need appending. this is one of the files i need to resort the data base has now …

Member Avatar for TrustyTony
0
425
Member Avatar for linezero

I'm trying to use this url as regex but it doesnt seems to be working 'sorry of my bad english' Full code: [CODE]Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://localhost/pos/leftpanel.html") Dim response As System.Net.HttpWebResponse = request.GetResponse Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim rssourcecode As String = sr.ReadToEnd Dim r As …

0
126
Member Avatar for killerpopiller

Hi, I can connect to an energy-meter (Baudrate 300!) and the logfile with 228 lines comes slowly in.[code=Python]line = ser.readline(eol='!') print line [/code] If I use the above code, the complete logfiles is shown. And if I parse separatly saved logfiles with match, it sorts out the right values into …

0
114
Member Avatar for judithSampathwa

hi there, i have been asking this question every time. [CODE] public bool ValidateTelNo(string TelNo) { bool value = false; string rePhoneNumber = @"[1-9]\d{2}\s?\d{3}\d{4}$"; string PhoneNoFormat = @"\([1-9]\d{2}\)\s?\d{3}\-\d{4}$"; Regex re = new Regex(rePhoneNumber); Regex re1 = new Regex(PhoneNoFormat); if (re.IsMatch(TelNo) || (re1.IsMatch(TelNo))) value = true; else value = false; return …

Member Avatar for kvprajapati
0
108
Member Avatar for mnmo88

Hi guys, this is the first time for me to post something, i'm really a big fan of the site and so far every time i get stuck in something at uni i come to here. so thanks for helping me survive so far. anywho, i'm here because i need …

Member Avatar for mnmo88
0
141
Member Avatar for jrhitokiri

I am trying to get Domain names/URLs from the title and description in ebay, but the text varies a lot. Note that the url/domain names are limited to *.com, *.net, *.info, etc. For instance, I'd have to parse through text such as: IPAD SCREEN LENS.COM 3 4 5 Letter LLLL …

Member Avatar for jrhitokiri
0
116
Member Avatar for DoctorGiraffe

Hello! Yes, This is my first post. And it might seem a little selfish that i just joined to ask a question, so don't worry, i'm not gonna ask and run, i'll stick around. So my problem, what im trying to do is using regex i'm pulling information from a …

Member Avatar for codeorder
0
965
Member Avatar for MisterSnrub

My form has a RegularExpressionValidator that validates user input in a textbox, lik so: [CODE] <asp:TextBox ID="taSSN" runat="server"></asp:TextBox> <asp:RegularExpressionValidator ID="revSSN" runat="server" ControlToValidate="taSSN" ValidationExpression="^\d{3}-\d{2}-\d{4}$"> Invalid! Remember, you MUST type in the dashes!! </asp:RegularExpressionValidator> [/CODE] Suppose that that the regular expression I want to validate is the standard U.S. Social Security Number …

0
70
Member Avatar for mr_scooby

Hey guys, I need to be able to get a certain value out of the following. [code] Job# : 442254 Contact : TO BE ADVISED Model : BZ500 50GN02630 Purchase Order/Your Reference : Contract Type: C3 CopyPlan - Contract Minimum Job Type: H Audit, Admin, Housekeeping Fault/Problem(s) reported: CHECK SENTINEL …

Member Avatar for mr_scooby
0
129
Member Avatar for etftw

Hello, I am currently passing some HTML through to preg_match and I want to access all the HTML between two tags, however as the same tags may be repeated afterwards my current expression isn't working. For example, my expression at the moment is [code]<li>(.*)</li>[/code] But as the HTML is like …

Member Avatar for pritaeas
0
91

The End.