Re: How do you use LLM AI tools in your daily programming workflow ? Community Center by rproffitt … it for many things. Examples such a SQL queries and regular expressions. He tells me they saved mid 5 figures USD in… Extracting values from capturing groups in regex Programming Software Development by Tom_45 …', '9') ('Collin', '', 'Collin') ('Raquel', '', 'Raquel') I'm relatively new to regular expressions so be gently, but any help would be appreciated. PS… Extracting values from a regex match Programming Software Development by Tom_45 …', '9') ('Collin', '', 'Collin') ('Raquel', '', 'Raquel') I'm relatively new to regular expressions so be gently, but any help would be appreciated. PS… Re: Extracting values from capturing groups in regex Programming Software Development by AndreRet … consider using non-greedy quantifiers - [Minimal or non-greedy quantifiers](Regular expressions are generally considered greedy because an expression with repetitions will… 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 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 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 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) Regular expression beginner Programming Software Development by arindam31 Regular Expression (RE) They can be used with string operations. Using … a p.iiiigand no gbng gtrg ghgg') p.i Slash ( \ ) Regular expressions use the backslash character ('\') to indicate special forms or to… Re: regular expression Programming Web Development by pritaeas Regular expressions are not for creating strings, but for parsing them. Re: Replace String what is the best way Programming Software Development by Tekmaven Regular expressions are the way to go. Using them in C# is easy, but developing the actual regular expression is slightly complicated. There are… I've used in the past to help me craft regular expressions, Regulazy and Regulator, both are made by Roy Osherove, and… Re: preg_replace Help Programming Web Development by digital-ether Regular expressions are quite simple. Instead of matching exact characters like in … the end delimiter, you have the modifiers (flags). So a regular expression could be: |a| That matches just the letter a… is very powerful. Take a look at: [url]http://www.regular-expressions.info/[/url] it has a lot of information on… Re: Java Pattern Programming Software Development by Krstevski Regular expressions are the same for all programming languages, the difference is …() '0123456789' [/CODE] Learn about [URL="http://www.regular-expressions.info/reference.html"]Regular Expression Syntax[/URL] and then you can implement… Re: matching two consecutive identical characters in awk Programming Software Development by ghostdog74 regular expressions are usually not needed for string manipulations. [code] # echo "abcdd" | awk 'BEGIN{FS=""}$2==$3{print "ok"}' # echo "abbdd" | awk 'BEGIN{FS=""}$2==$3{print "ok"}' ok [/code] Re: String Help Programming Web Development by EvolutionFallen Regular Expressions is what you're looking for. As ShawnCplus said, preg_match() is the function you'll want to use. You might want to do some reading on regular expressions. I used this tutorial a while ago: [url]http://www.regular-expressions.info/tutorial.html[/url] Re: preq_match Programming Web Development by blocblue Regular expressions can be tough to understand. Taking the example you've …, flag. The [B].[/B] character has a special meaning in regular expressions, in that it matches any character. To use this as… [B]-[/B] character is used to specify a range in regular expressions, e.g. 0-3 or a-z. This again is… Re: Search Text to Create Links Programming Web Development by cmhampton Regular Expressions should do the trick for this. [code=c#] //Find the …'s still pretty efficient. Here's a great resource for regular expressions: [url]http://regexlib.com/Default.aspx[/url] Re: How to call php validation function using ajax Programming Web Development by deepaksh Regular expressions (REGEX) are the easiest way to verify the full name format in PHP. You can easily verify the first name and last name using regular expressions in PHP. Re: Searching a Text Field in a JList Programming Software Development by peter_budo Regular expression is answer to your problem. Ofcourse you can do it with substrings, but it is dirty work. Read up Sun tutorial on regular expressions [URL="http://java.sun.com/docs/books/tutorial/essential/regex/"]here[/URL] Re: RegExp.replace Not Working Programming Web Development by tgreer Regular Expressions have always been very difficult for me, for some reason. I'd be happy to try to help when I have a bit more time later this week. Can you post a very simple "test harness" version of your HTML here? Re: how to read csv file without using StringTokenizer Programming Software Development by Ezzaral Regular expressions can be tricky to learn, but they are very powerful … Re: Identifying one set of strings from within a longer string Programming Software Development by Ramy Mahrous Regular expressions would help System.Text.RegularExpressions;