Re: What Would You Like To See In A SearchEngine ? Community Center Geeks' Lounge by Dani Just genuinely curious what ever became of this project? Extracting values from capturing groups in regex Programming Software Development by Tom_45 I am trying to extract three values from the td tags in an html downloaded file. <tr align="right"><td>236</td><td>Roy</td><td>Allyson</td> <tr align="right"><td>237</td><td>Marvin</td><td>Pamela</td> <tr align="right"><td… Extracting values from a regex match Programming Software Development by Tom_45 I am trying to extract three values from the td tags in an html downloaded file. <tr align="right"><td>236</td><td>Roy</td><td>Allyson</td> <tr align="right"><td>237</td><td>Marvin</td><td>Pamela</td> <tr align="right"><td… Re: Extracting values from capturing groups in regex Programming Software Development by Reverend Jim For html = '<tr align="right"><td>236</td><td>Roy</td><td>Allyson</td>' pat = '<td>(.+?)</td>' then re.split(pat,html) returns ['<tr align="right">', '236', '', 'Roy', '', 'Allyson', ''] and re.split(pat,html)[1::2] will … Re: Extracting values from a regex match Programming Software Development by Reverend Jim The trick is to use lazy matching which matches the shortest possible string. html = '<tr align="right"><td>236</td><td>Roy</td><td>Allyson</td>' pat = '<td>(.+?)</td>' then re.split(pat,html) returns ['<tr align="right">', '236', … Re: Extracting values from capturing groups in regex Programming Software Development by Tom_45 I'm not getting the results you presented, I'm getting the whole file not just the tr tags. The tr tags I used was just a subset of the entire file. Re: Extracting values from capturing groups in regex Programming Software Development by Reverend Jim Just process the file line by line and apply the regular expression to particular lines. I can't give you an expression that matches only the lines you showed me with a guarantee that in matches nothing else without seeing the entire file. Re: Extracting values from capturing groups in regex Programming Software Development by Reverend Jim You can either read the entire file into a list, then filter that list, or you could process it line by line and process each matching line. For example (using my file) for line in open('usblog.txt'): if '2024-01-24' in line: print(line) or text = open('usblog.txt').readlines() for line in [x for x in text if… Re: Extracting values from a regex match Programming Software Development by pritaeas Sidenote: If you want to learn, understand and experiment with regexes I can highly recommend RegexBuddy. Re: Extracting values from capturing groups in regex Programming Software Development by Tom_45 It's a long one, but here it is. <head><title>Popular Baby Names</title> <meta name="dc.language" scheme="ISO639-2" content="eng"> <meta name="dc.creator" content="OACT"> <meta name="lead_content_manager" content="JeffK"&… Re: Extracting values from capturing groups in regex Programming Software Development by Reverend Jim Try import re pat = '<td>(.+?)</td>' for line in open('yourfile.html'): if line.startswith('<tr align="right"><td>'): print(re.findall(pat,line)) I realized that findall is cleaner than split. You might want to have a look at [this regex online tool](https://www… Re: Extracting values from a regex match Programming Software Development by Reverend Jim Also [autoregex](https://www.autoregex.xyz/) Re: Extracting values from capturing groups in regex Programming Software Development by AndreRet Your main issue is with the way you're trying to capture the values inside the 'td' tags. Also, you should consider using non-greedy quantifiers - [Minimal or non-greedy quantifiers](Regular expressions are generally considered greedy because an expression with repetitions will attempt to match as many characters as possible. The asterisk (*), plus… Re: Extracting values from a regex match Programming Software Development by AndreRet Same question, different post - [Extracting values from capturing groups in rege](https://www.daniweb.com/programming/software-development/threads/541420/extracting-values-from-capturing-groups-in-regex) Re: Extracting values from capturing groups in regex Programming Software Development by Tom_45 Issue resolved Re: Extracting values from a regex match Programming Software Development by Tom_45 Question has been answered. The correct pattern is: matches = re.findall(r'<td>(\d+)+<\/td><td>(\w+)<\/td><td>(\w+)', file) Re: What Would You Like To See In A SearchEngine ? Community Center Geeks' Lounge by Dani Why would I, as the website publisher, fill out a form on your search engine's website anytime I update a page? PS/2 to USB Question Hardware and Software Hardware by Klaital I use a laptop and it doesn't have any PS/2 ports only USB. My wife just bought a keyboard for her computer and it came with a PS/2 to USB adapter. Well my USB keyboard is crappin out so I tryed hooking a older PS/2 keyboard up with the adapter but it just says device not reconized. I searched google but all I can find is adapters for sale and no … Re: PS/2 to USB Question Hardware and Software Hardware by SidTheKid [QUOTE=Klaital;316855]My wife just bought a keyboard for her computer and it came with a PS/2 to USB adapter.[/QUOTE] Hi Cheesy The USB/PS2 adapters that come with a keyboard don't generally work well in my experience. What I had to do when I got my laptop hooked up to a KVM switch was get a little gadget that has a single USB connector on … Re: ps command Hardware and Software Linux and Unix by TheOgre Read the: manpage for ps ("man ps") info page for ps ("info ps") ps command Hardware and Software Linux and Unix by walker use of ps command in Linux rad hat without any options (-ef, -aux or a), what is the result will be list (PID TTY TIME CMD only)? Can I use ps alone for investigate the executed machine on which the command was entered with maintenance program that been run at the current machine? What is the define level for a rogue processes in a system? By using… Re: ps command Hardware and Software Linux and Unix by TheOgre You need to start a new thread for your questions, as they have nothing to do with the ps command, as originally asked by walker. Drive repartitioning and file permissions have nothing to do with ps... ps file Programming Software Development by NewVBguy Hi there, How can I extract a ps file (eg. sample.ps) and put it into recordset. Thanks. Newvbguy PS/2 Mouse Hardware and Software Hardware by Booski I tried to use my PS/2 mouse, but after pluggin it in and booting up it wouldn't work. I went to control panel>mouse>hardware>Microsoft PS/2 Mouse, and when I clicked on that, at the bottom it said "Device Status: This device cannot start. (Code 10)" Here is a screenshot. [IMG]http://i154.photobucket.com/albums/s274/… Re: ps command Hardware and Software Linux and Unix by knute [font=Arial Narrow]Just tried it. The output shows the command, tty pid and the time for the current terminal only. I did it in term 1 on my desktop and it only listed the shell that I was using and the ps command itself. Hope that answers your question. Oh yeah, and top is mentioned in the man page as well. :) [/font] Re: ps file Programming Software Development by Comatose Extract a PS file from a record set? Ps/2 (possible) port problem Hardware and Software Hardware by JANINE I am currently working on a PC belonging to a friend and am experiencing the following problem. The PC will start up ok but as it is going through the Post process it comes up with KEYBOARD ERROR - KEYBOARD MISSING OR NOT FOUND. I have tried two brand new keyboards that i know work on other machines (have tested them) and both keyboards lights … PS/2 connector fried? Hardware and Software Hardware by Nanino Hey, Nanino here. Recently, after a power outage, my computer's keyboard stopped responding to anything. I've tried multiple keyboards, but none of them work now. Though when I connect them the num lock/caps lock/scroll lock lights all blink then turn off, which makes me think the keyboards are still recieving power. Originally, on start up … Re: PS/2 connector fried? Hardware and Software Hardware by sittas87 ohk dont worry about the cmos checksum error,as long as your cmos is properly seated all is fine.what you can do now in your BIOS set all to defaults. As for the keyboard still being in its current morbid state,try a USB keyboard if its easy for you to obtain one just for testing. Im thing PS\2 for mouse controller thats corrupted. but try a usb … PS/2 and USB Mice Hardware and Software Microsoft Windows by cyclone3211 Currently have 2 mice installed and working at the same time. It appears that they are using the same driver. Some times after re-boot, the PS/2 mouse does not work until the next re-boot. Does this setup of having 2 mice operating at the same time create any computer operating issues? OS WinXP Media SP2