Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
ps4
- Page 1
Re: What Would You Like To See In A SearchEngine ?
Community Center
Geeks' Lounge
3 Weeks Ago
by Dani
Why would I, as the website publisher, fill out a form on your search engine's website anytime I update a page?
Re: What Would You Like To See In A SearchEngine ?
Community Center
Geeks' Lounge
3 Weeks Ago
by Dani
Just genuinely curious what ever became of this project?
Extracting values from capturing groups in regex
Programming
Software Development
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
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
2 Months Ago
by Reverend Jim
Also [autoregex](https://www.autoregex.xyz/)
Re: Extracting values from capturing groups in regex
Programming
Software Development
2 Months Ago
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
2 Months Ago
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
2 Months Ago
by Tom_45
Issue resolved
Re: Extracting values from a regex match
Programming
Software Development
1 Month Ago
by Tom_45
Question has been answered. The correct pattern is: matches = re.findall(r'<td>(\d+)+<\/td><td>(\w+)<\/td><td>(\w+)', file)
grep all but first line
Programming
Software Development
13 Years Ago
by TheWhite
"ps aux" outputs the following as the first line: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND how can I preserve this line if I do a "ps aux | grep <someuser>" so that I can still see the header for each column? In essence, I want to grep all but the first line of the initial "ps …
Re: grep all but first line
Programming
Software Development
13 Years Ago
by thekashyap
ps supports and option "h" (not -h) that suppresses the header from getting printed. See "OUTPUT FORMAT CONTROL" section in "man ps".
Re: Sudoku Solver 2D array not updating
Programming
Software Development
11 Years Ago
by sirlink99
pS is the array which holds the the numbers for all the missing spots in the array. since more then 9 numbers can be missing from the puzzle, pS.length can be larger than 9. The idea is that the spot where the 0s were in ans point to an element in the pS array, which in turn point to a number between 1 and 9. so by changing the pS array, the …
Re: Try to find the output in the query will update data in mysql database? us
Programming
Web Development
10 Years Ago
by masijade
ps=con.prepareStatement("update employees set EmployeeName=?,Nationality=?"); ps.setString(1, EmployeeName); ps.setString(3, Nationality); Uhm, where did the "where clause" portion of the statement go? And how many question marks do you count in this statement? And is the index you used larger than this?…
Re: need help getting pid value
Programming
Software Development
16 Years Ago
by sbecker
ps -ef | grep truecomp | awk '{print $2}' is the usual way.
Re: Try to find the output in the query will update data in mysql database? us
Programming
Web Development
10 Years Ago
by pritaeas
> ps.setInt(2, Employee_id); > ps.setString(3, Nationality); Wrong order again. I suggest you add: catch(Exception e) { out.print(e.getMessage()); e.printStackTrace(); } to get more information.
Re: defining operator< for personal class that use std::sort of vector
Programming
Software Development
10 Years Ago
by Vasthor
PS: the operators works on "normal" comparison like if (Obj1 < Obj2) and this exercise is present on sub-chapter about swap and it's use in copy-assignment operator for the classes. (probably unrelated, well who knows?)
Re: Copy argv to string in C(newbie question)
Programming
Software Development
16 Years Ago
by Duoas
> PS: memcpy is safer No it's not. It will try to copy [B][I]n[/I][/B] characters whether it hits an architecture-dependent read boundary or not. Use [B]strncpy()[/B]. It is fully standard and stops in the right place. To convert a string to an integer [inlinecode]#include <cstdlib>[/inlinecode] and use the [B]atoi()[/B] function: […
Re: IO problem...
Programming
Software Development
16 Years Ago
by iamthwee
>PS:: are there any simular tutorials for c++ There is yes. [url]http://www.daniweb.com/tutorials/tutorial71858.html[/url] And if you want to fall asleep the below is a must read: :P [url]http://www.daniweb.com/forums/thread90228.html[/url] If you want to avoid all the theory you could read everything in as strings then convert to …
Re: Quicken wont work
Hardware and Software
Microsoft Windows
16 Years Ago
by eowyn0622
ps - did a spyware/virus scan and found trojan-phisher-snifula just now. COuld this have corrupted my Quicken connection?
Re: C++ possible?
Programming
Software Development
15 Years Ago
by Ancient Dragon
>> PS: C vs. C++ whats difference? see [URL="http://www.google.com/search?hl=en&q=difference+between+c+and+c%2B%2B"]these google links.[/URL] >>what should I use? Its up to you, but I would use c++ because you can use c++ container classes like vector that does all the dynamic memory allocation for you. You can …
Re: even and odd columsn
Programming
Software Development
15 Years Ago
by rockX
PS: thank you.:-)
Re: Understanding functions
Programming
Software Development
14 Years Ago
by lllllIllIlllI
> PS. What's the Python code tag? When I call (code=python) I don't get the formating or syntax highlighting. Yeah thats an issue right now. http://daniweb.com/forums/thread189444.html
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC