findall Questions

4

Solved

How can I find all matches that don't necessarily consume all characters with * and + modifiers? import regex as re matches = re.findall("^\d+", "123") print(matches) # actual o...
Influence asked 21/7, 2023 at 20:50

13

I want to use the method of findall to locate some elements of the source xml file in the ElementTree module. However, the source xml file (test.xml) has namespaces. I truncate part of xml file as ...
Garrett asked 16/11, 2012 at 7:53

3

Solved

Below are a simple html source code I'm working with <html> <head> <title>Welcome to the comments assignment from www.py4e.com</title> </head> <body> <h1>T...
Glitter asked 8/3, 2022 at 20:41

4

Solved

re.findall("(100|[0-9][0-9]|[0-9])%", "89%") This returns only result [89] and I need to return the whole 89%. Any ideas how to do it please?
Truckload asked 16/4, 2013 at 19:39

6

Solved

Say I have a string s containing letters and two delimiters 1 and 2. I want to split the string in the following way: if a substring t falls between 1 and 2, return t otherwise, return each char...
Ellaelladine asked 6/7, 2014 at 7:57

2

I am trying to use beautifulsoup to parse a table from a website. (I am unable to share the website source code as it is restricted use.) I am trying to extract the data only if it has following t...
Polyneuritis asked 7/11, 2016 at 8:36

1

Solved

I'm trying to extract salaries from a list of strings. I'm using the regex findall() function but it's returning many empty strings as well as the salaries and this is causing me problems later in...
Hose asked 4/4, 2019 at 10:9

2

Solved

I'm looking to scan a group of .cs files to see which ones call the Value property of a Nullable<T> (finding all references). For example, this would match: class Program { static void Main...
Cacophony asked 6/8, 2015 at 17:6

3

Solved

Given a list of strings like: L = ['1759@1@83@0#[email protected]@[email protected]#1094@[email protected]@14.4', '[email protected]@[email protected]', '[email p...
Aquarist asked 11/3, 2019 at 7:16

1

Solved

I need extract double Male-Cat: a = "Male-Cat Male-Cat Male-Cat-Female" b = re.findall(r'(?:\s|^)Male-Cat(?:\s|$)', a) print (b) ['Male-Cat '] c = re.findall(r'\bMale-Cat\b', a) print (c) ['Male-...
Gonyea asked 16/10, 2017 at 8:22

1

I am trying to use BeautifulSoup to find all div containers with the class attribute beginning by "foo bar". I had hoped the following would work: from bs4 import BeautifulSoup import re soup.fi...
Miki asked 3/5, 2016 at 6:2

3

Solved

The code below won't compile: Func<Person, bool> theLambda = (p) => p.Year >= 1992; foreach (Person pers in PersonList.FindAll(theLambda)) { Console.WriteLine(pers.Name); } public ...
Myeshamyhre asked 31/10, 2015 at 15:31

1

Solved

How can i get input value from html page like <input type="hidden" name="captId" value="AqXpRsh3s9QHfxUb6r4b7uOWqMT" ng-model="captId"> I have input name [ name="captId" ] and need his v...
Architectonic asked 27/5, 2015 at 17:26

3

My re.findall search is matching and returning the right string, but when I try to print the result, it prints it as a list instead of a string. Example below: > line = ID=id5;Parent=rna1;Dbxre...
Lehman asked 29/3, 2015 at 5:5

1

I have to fetch all data from table which has latitudes / longitudes values.Actually I just required all latitudes / longitudes values which is within 1000 miles from a source, So for that I used c...
Quackery asked 21/12, 2014 at 16:44

3

Solved

When I was trying to answer this question: regex to split %ages and values in python I noticed that I had to re-order the groups from the result of findall. For example: data = """34% passed 23% f...
Degradable asked 2/9, 2014 at 17:24

4

I have several Controllers like those: CategoryController and NewsController As well as the domain models for category and news and reposirtories for both. In the NewsController I do a dependencyI...
Somewhere asked 22/7, 2012 at 17:11

4

Here is the code I have: a='<title>aaa</title><title>aaa2</title><title>aaa3</title>' import re re.findall(r'<(title)>(.*)<(/title)>', a) The resu...
Natiha asked 20/7, 2013 at 19:15

3

Solved

Have a set of string as follows text:u'MUC-EC-099_SC-Memory-01_TC-25' text:u'MUC-EC-099_SC-Memory-01_TC-26' text:u'MUC-EC-099_SC-Memory-01_TC-27' These data i have extracted from a Xls file and ...
Levesque asked 18/10, 2013 at 12:29

1

Solved

I trying to build dynamic filters using findAll on a list. I have a variable that needs to be included in the filter only if not null. @Test void testSample(){ def list = [ new Employee(age:22...
Gastrulation asked 8/8, 2013 at 21:38

3

Solved

i'm trying to get the start and end positions of a query in sequence by using re.findall import re sequence = 'aaabbbaaacccdddeeefff' query = 'aaa' findall = re.findall(query,sequence) >&gt...
Thrombokinase asked 11/7, 2013 at 22:17

3

Solved

>>> match = re.findall('a.*?a', 'a 1 a 2 a 3 a 4 a') >>> match ['a 1 a', 'a 3 a'] How do I get it to print ['a 1 a', 'a 2 a', 'a 3 a', 'a 4 a'] Thank you!
Hexagonal asked 4/7, 2013 at 10:5

1

Solved

is there a way to use the findAll() function with conditions? I want to do something like ->findAll('active'=1); I know that i can write custom repository classes but just for a simple "wher...
Pirouette asked 7/2, 2013 at 10:2

1

Solved

Is it possible to access the symbolic group name defined in a regular expression with (?P<toto>...) with the equivalent of re.findall()? Using re.match(), re returns a MatchObject on which t...
Inexpungible asked 27/11, 2012 at 13:30

4

I have a string consisting of parameter number _ parameter number: dir = 'a1.8000_b1.0000_cc1.3000_al0.209_be0.209_c1.344_e0.999' I need to get the number behind a parameter chosen, i.e. par='...
Admissive asked 31/8, 2012 at 8:52

© 2022 - 2025 — McMap. All rights reserved.