用于板块的android正则表达式

时间:2017-05-12 22:09:14

标签: java android

我想在android中生成一个正则表达式来检查像

这样的板号

3个字母1个空格和4个十进制数

LLL NNNN

1 个答案:

答案 0 :(得分:1)

那将是import random import time player_1 = input("") player_2 = input("") def rollDice(player_1): ran_num = random.randint(1,6) if ran_num == 1: print("You rolled a",ran_num) else: print("You rolled a",ran_num) p1_score = ran_num+ran_num def rollDice(player_2): ran_num = random.randint(1,6) if ran_num == 1: print("You rolled a",ran_num) else: print("You rolled a",ran_num) p2_score = ran_num+ran_num print("Please press ENTER to roll the dice") input() rollDice(player_1) print("Good job",player_1,) print("Your score is now",p1_score) time.sleep(5) print(player_2,"Press ENTER to roll the dice") input() rollDice(player_2) print("Nice work",player_2) print("Your score is now",p2_score) def main(): rollDice(player1, player2) main() 作为Java字符串