per page, with , order by , clip by
Results of 1 - 7 of about 7 for findall (0.008 sec.)
xml.etree.ElementTree --- ElementTree XML API 13268
xml.etree.ElementTree --- ElementTree XML API Source code: Lib/xml/etree/ElementTree.py xml.etree.ElementTree モジュールは、XML データの解析と作成を行うシンプルで効率的な API を実装しています。 バージョン 3.3 で変更: このモジュールは利用出来 ... me': 'Malaysia', 'direction': 'N'} {'name': 'Costa Rica', 'direction': 'W'} {'name': 'Colombia', 'direction': 'E'} Element.findall() はタグで現在の要素の直接の子要素のみ検索します。 Element.find() は特定のタグで 最初の 子要素を検索し、 Element.text は要 ... 素のテキストコンテンツにアクセスします。 Element.get() は要素の属性にアクセスします: >>> for country in root . findall ( 'country' ): ... rank = country . find ( 'rank' ) . text ... name = country . get ( 'name' ) ... print ( name , rank ) . ... を使って要素を削除することが出来ます。例えば rank が 50 より大きい全ての country を削除したい場合: >>> for country in root . findall ( 'country' ): ... # 走査中の削除を避けるため root.findall() を使う ... rank = int ( country . find ( 'rank' ) . text ) .. ...
https://man.mtool.work/python/3.14/library/xml.etree.elementtree.html
re --- 正規表現操作 9578
re --- 正規表現操作 ソースコード: Lib/re/ このモジュールは Perl に見られる正規表現マッチング操作と同様のものを提供します。 パターンおよび検索される文字列には、Unicode 文字列 ( str ) や 8 ビット文字列 ( bytes ) を使います。ただし、Unicode 文 ... と flags を位置引数として渡すことは非推奨です。 将来の Python バージョンでは、これらは キーワード専用引数 になります。 re. findall ( pattern , string , flags = 0 ) string 内の pattern に重複せずにマッチするすべての部分を、文字列またはタプルのリストとして ... 合は、各グループにマッチする文字列のタプルのリストを返します。 キャプチャしないグループは結果の形式に影響しません。 >>> re . findall ( r '\bf[a-z]*' , 'which foot or hand fell fastest' ) ['foot', 'fell', 'fastest'] >>> re . findall ( r '(\w+)=(\d+)' , 'se ... ersion 3.4. Pattern. split ( string , maxsplit = 0 ) split() 関数にこのコンパイル済みパターンを使うのと同じです。 Pattern. findall ( string [ , pos [ , endpos ] ] ) findall() 関数にこのコンパイル済みパターンを使うのと似ていますが、オプションの pos および ...
https://man.mtool.work/python/3.14/library/re.html
正規表現 HOWTO 8942
正規表現 HOWTO Author : A.M. Kuchling < amk @ amk . ca > 概要 このドキュメントは re モジュールを使って Python で正規表現を扱うための導入のチュートリアルです。ライブラリレファレンスの正規表現の節よりもやさしい入門ドキュメントを用意しています ... f the RE matches at the beginning of the string. search() 文字列を先頭から走査して、正規表現がどこにマッチするか調べます。 findall() 正規表現にマッチする部分文字列をすべて見つけ、リストで返します。 finditer() 正規表現にマッチする部分文字列をすべて見つけ ... group ()) else : print ( 'No match' ) あるパターンにマッチするもの全てを返す Pattern インスタンスのメソッドが2つあります。 findall() はマッチした文字列のリストを返します: >>> p = re . compile ( r '\d+' ) >>> p . findall ( '12 drummers drumming, 11 piper ... ラルに書くと、現在は SyntaxWarning が発生し、将来は SyntaxError になるためです。 バックスラッシュの悩み を参照してください。 findall() は結果を返す前に完全なリストを必ず生成してしまいます。いっぽう finditer() メソッドは マッチオブジェクト インスタンスのシ ...
https://man.mtool.work/python/3.14/howto/regex.html
10. 標準ライブラリをひとめぐり 8306
10. 標準ライブラリをひとめぐり 10.1. オペレーティングシステムとのインターフェース os モジュールは、オペレーティングシステムと対話するための多くの関数を提供しています: >>> import os >>> os . getcwd () # Return the current working directory ' ... 正規表現を提供しています。正規表現は複雑な一致検索や操作に対して簡潔で最適化された解決策を提供します: >>> import re >>> re . findall ( r '\bf[a-z]*' , 'which foot or hand fell fastest' ) ['foot', 'fell', 'fastest'] >>> re . sub ( r '(\b[a-z]+) \1' , r '\1 ...
https://man.mtool.work/python/3.14/tutorial/stdlib.html
collections --- コンテナデータ型 7815
collections --- コンテナデータ型 ソースコード: Lib/collections/__init__.py このモジュールは、汎用の Python 組み込みコンテナ dict , list , set , および tuple に代わる、特殊なコンテナデータ型を実装しています。 namedtuple() 名前付きフィールドを ... Counter({'blue': 3, 'red': 2, 'green': 1}) >>> # Hamlet で最も頻出する単語を 10 個見つける >>> import re >>> words = re . findall ( r '\w+' , open ( 'hamlet.txt' ) . read () . lower ()) >>> Counter ( words ) . most_common ( 10 ) [('the', 1143), ('and', ...
https://man.mtool.work/python/3.14/library/collections.html
What's New In Python 3.4 7815
What's New In Python 3.4 著者 : R. David Murray < rdmurray @ bitdance . com > (編集者) この記事では 3.3 と比較した Python 3.4 の新機能を解説します。 Python 3.4 は2014年3月16日にリリースされました。全詳細については 変更履歴 をご覧ください。 ... いはずです。許されなくなったコマンド形式は意味をなしていなかったものですから、使われていたとは思えません。 re.split() 、 re.findall() 、 re.sub() 関数と、 match オブジェクトの group() 、 groups() メソッドは、マッチ対象の文字列が bytes-like object の場合、 ...
https://man.mtool.work/python/3.14/whatsnew/3.4.html
変更履歴 7815
変更履歴 次の Python バージョン リリース日: XXXX-XX-XX セキュリティ gh-160499 : Fix unbounded memory growth in asyncio TLS connections when a peer stops reading but keeps sending records that make OpenSSL generate its own replies (such as T ... ドキュメントで XPath のインデックス述語 ( [1] 、 [last()] 、 [last()-N] ) を使用する際、 xml.etree.ElementTree.Element の findall() 、 iterfind() 、 find() メソッドが二次の計算量にならないようにしました。 gh-152216 : 同梱の libexpat をバージョン 2.8.2 ...
https://man.mtool.work/python/3.14/whatsnew/changelog.html
PREV 1 NEXT