Top Fields Constructors Methods
org.python.modules.sre

public Class PatternObject

extends PyObject
implements Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc
Annotations
@ExposedType
name:SRE_Pattern
doc:Compiled regular expression objects
Imports
java.util.*, org.python.core.*, org.python.expose.ExposedGet, .ExposedMethod, .ExposedType

Field Summary

Modifier and TypeField and Description
pack-priv int[]
public int
public int
public PyObject
public int
pack-priv PyObject
public PyString
Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtypeTYPE

Constructor Summary

AccessConstructor and Description
public
PatternObject(PyString pattern, int flags, int[] code, int groups, PyObject groupindex, PyObject indexgroup)

Method Summary

Modifier and TypeMethod and Description
private void
_error(int status)

pack-priv MatchObject
_pattern_new_match(SRE_STATE state, PyString string, int status)

private PyObject
call(String module, String function, PyObject[] args)

private static PyString
public PyObject
findall(PyObject[] args, String[] kws)

public PyObject
finditer(PyObject[] args, String[] kws)

public int
public PyObject
public int
public PyString
private PyObject
join_list(PyList list, PyString string)

public PyObject
match(PyObject[] args, String[] kws)

public boolean
public ScannerObject
scanner(PyObject[] args, String[] kws)

public PyObject
search(PyObject[] args, String[] kws)

public PyObject
split(PyObject[] args, String[] kws)

public PyObject
sub(PyObject[] args, String[] kws)

public PyObject
subn(PyObject[] args, String[] kws)

private PyObject
subx(PyObject template, PyString instring, int count, boolean subn)

public int
traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyObject:
__abs____add____and____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____cmp____coerce____coerce_ex____complex____contains____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____eq____findattr____findattr____findattr_ex____finditem____finditem____finditem____float____floordiv____format____ge____get____getattr____getattr____getitem____getitem____getnewargs____getslice____getslice____gt____hash____hex____iadd____iand____idiv____idivmod____ifloordiv____ilshift____imod____imul____index____int____invert____ior____ipow____irshift____isub____iter____iternext____itruediv____ixor____le____len____long____lshift____lt____mod____mul____ne____neg____nonzero____not____oct____or____pos____pow____pow____radd____rand____rawdir____rdiv____rdivmod____reduce____reduce_ex____reduce_ex____repr____rfloordiv____rlshift____rmod____rmul____ror____rpow____rrshift____rshift____rsub____rtruediv____rxor____set____setattr____setattr____setitem____setitem____setitem____setslice____setslice____str____sub____tojava____truediv____trunc____unicode____xor___add_and_callextra_cmp_div_divmod_doget_doget_doset_eq_floordiv_ge_gt_iadd_iand_idiv_idivmod_ifloordiv_ilshift_imod_imul_in_ior_ipow_irshift_is_isnot_isub_itruediv_ixor_jcall_jcallexc_jthrow_le_lshift_lt_mod_mul_ne_notin_or_pow_rshift_sub_truediv_unsupportedop_xoradaptToCoerceTupleasDoubleasIndexasIndexasIntasIntasIterableasLongasLongasNameasNameasStringasStringasStringOrNullasStringOrNullbit_lengthconjugatedelDictdelTypedispatch__init__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypehashCodeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisMappingTypeisNumberTypeisSequenceTypemergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___subclasshook__readonlyAttributeErrorrunsupportedopMessagesetDictsetTypetoStringunsupportedopMessage

Field Detail

codeback to summary
pack-priv int[] code
codesizeback to summary
public int codesize
flagsback to summary
public int flags
groupindexback to summary
public PyObject groupindex
groupsback to summary
public int groups
indexgroupback to summary
pack-priv PyObject indexgroup
patternback to summary
public PyString pattern

Constructor Detail

PatternObjectback to summary
public PatternObject(PyString pattern, int flags, int[] code, int groups, PyObject groupindex, PyObject indexgroup)

Method Detail

_errorback to summary
private void _error(int status)
_pattern_new_matchback to summary
pack-priv MatchObject _pattern_new_match(SRE_STATE state, PyString string, int status)
callback to summary
private PyObject call(String module, String function, PyObject[] args)
extractPyStringback to summary
private static PyString extractPyString(ArgParser ap, int pos)
findallback to summary
public PyObject findall(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:findall(string[, pos[, endpos]]) --> list. Return a list of all non-overlapping matches of pattern in string.
finditerback to summary
public PyObject finditer(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:finditer(string[, pos[, endpos]]) --> iterator. Return an iterator over all non-overlapping matches for the RE pattern in string. For each match, the iterator returns a match object.
getFlagsback to summary
public int getFlags()
Annotations
@ExposedGet
name:flags
getGroupindexback to summary
public PyObject getGroupindex()
Annotations
@ExposedGet
name:groupindex
getGroupsback to summary
public int getGroups()
Annotations
@ExposedGet
name:groups
getPatternback to summary
public PyString getPattern()
Annotations
@ExposedGet
name:pattern
join_listback to summary
private PyObject join_list(PyList list, PyString string)
matchback to summary
public PyObject match(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:match(string[, pos[, endpos]]) --> match object or None. Matches zero or more characters at the beginning of the string
refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob)

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

Annotations
@Override
scannerback to summary
public ScannerObject scanner(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
searchback to summary
public PyObject search(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:search(string[, pos[, endpos]]) --> match object or None. Scan through string looking for a match, and return a corresponding match object instance. Return None if no position in the string matches.
splitback to summary
public PyObject split(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:split(string[, maxsplit = 0]) --> list. Split string by the occurrences of pattern.
subback to summary
public PyObject sub(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:sub(repl, string[, count = 0]) --> newstring Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
subnback to summary
public PyObject subn(PyObject[] args, String[] kws)
Annotations
@ExposedMethod
doc:subn(repl, string[, count = 0]) --> (newstring, number of subs) Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.
subxback to summary
private PyObject subx(PyObject template, PyString instring, int count, boolean subn)
traverseback to summary
public int traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.

Annotations
@Override