Каковы параметры для GridLayout?

Не используйте группы:

import re

s = "Za @Foo_Bar: @BAR_foo @FooBAR @BArfoo"
g = re.findall(r'(?:Za\s)@\w+|(?<=@)\w+', s)
print(g)

Вывод:

['Za @Foo_Bar', 'BAR_foo', 'FooBAR', 'BArfoo']

Объяснение:

  (?:Za\s)  # non capture group
  @         # @
  \w+       # 1 or more word character
|           #
  (?<=@)    # lookbehind, make sure we have @ before
  \w+       # 1 or more word character
5
задан mmcdole 12 December 2008 в 01:16
поделиться

2 ответа

Класс GridLayout:

public GridLayout(int rows,
                  int cols,
                  int hgap,
                  int vgap)

Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.
In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed between each of the columns. Vertical gaps are placed between each of the rows.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

All GridLayout constructors defer to this one.

Parameters:
rows - the rows, with the value zero meaning any number of rows
cols - the columns, with the value zero meaning any number of columns
hgap - the horizontal gap
vgap - the vertical gap
8
ответ дан 18 December 2019 в 13:20
поделиться
6
ответ дан 18 December 2019 в 13:20
поделиться
Другие вопросы по тегам:

Похожие вопросы: