S
S
SHentai2018-06-14 20:47:51
Regular Expressions
SHentai, 2018-06-14 20:47:51

How to compose a similar(down) regular expression?

Hello.
You need to make sure that there is a check for:
1. At the end of the line there is .phar or .php
2. The line contains only English characters from az AZ, and /.
Everything.

/src/pocketmine/PocketMine.php - true
/src/pocketmine/PocketMine - false
PocketMine-MP.phar - true
' ls - false

Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2018-06-14
@0xD34F

^[a-zA-Z\/-]+\.(php|phar)$

N
Nick Sdk, 2018-06-14
@lidacriss

^[a-zA-Z\/\-]+\.(phar|php)$
https://regex101.com/r/c5Bqtf/2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question