![]() Which would give you the same exact result. Or just omit regex altogether and just do: matches = You could honestly do something like: matches = # you need to be passing 'issue', not whatever 'string' is.Īdditionally, your regular expression is not correct, which means you will always return None, because it's not finding it, even if you do figure out a loop. # so if you're searching for a regex in each "issue" object then # read the documentation about re.search() So if you want to do an operation to a list of items, again you want to do use a for item in list: loop like described above. Regarding your additional question about RegEx: Using "=" will always return True or False (Boolean). Writing variable = other_var with two "=" rather than one is asking Python for the identity of the object, not setting the value. Writing doesn't convert the variable to a list, it just puts that object inside of a list. If you want to store the value in something else that won't do it. Print() only writes the value to the standard output. You can also do this even simpler with list comprehension.īut again, if you're able to do the last two then the first one ought to work right away, because the second two require the object to be iterable. # use the append method of the issues list object to add each issue to it If that doesn't work you can also try # declare an empty list If test is an iterable object then it might just convert straight to a list. And to be more precise, create a list of issuesĭoes not find the value despite trying to pass the value from the list all the time none Now we need to put one value of the issues list there. Here's what it looks like for a single file. While not appropriate for every role, this is a quick list of yes/no. This is how the values I got look like and I need a little help to continue working import re Founded in 2008, its the largest part of the Stack Exchange network a family of. But if I insert my "list" then everything breaks down test = ( I wrote a regular expression ep = r'\s*( )(\d )\s*'Īnd checked that it works with the basic version. I need to split the parameter into epxx, seqxx, shxx List of list stack exchange how to#But I do not understand how to work with it using regular expressions. I tried to make a list out of this by wrapping it in and thus I get only the first value. Which comes from python-redmine in column one by one. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |