Top "Preg-match" questions

Regular expression pattern matching function for the PHP programming language

Regex for BIC check

I wrote a regex for php function pregmatch which is like this: ^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$^ Now I …

php regex preg-match bank iban
Regex match string that ends with number

What is a regex to match a string that ends with a number for example "c1234" - match "c12" - …

php regex preg-match regex-negation
Get all matches from string that start with and end, using php

How would I use PHP to extract everything in between [startstring] and [endstring] from this string: [startstring]hello = guys[endstring] …

php regex preg-match preg-match-all
Test if a string is regex

Is there a good way of test if a string is a regex or normal string in PHP? Ideally I …

php regex preg-match
PHP - preg_match - How to match a string upper/lower case with anything before or after it?

I have a part of a function that goes like this: if (preg_match("#\bscript\b#",$userInput)) { $bannedWord = 'script'; logHax(); …

php preg-match variations
preg: how to write a preg pattern to get domain name from an email?

From an email address like [email protected] I want to fetch domain name gmail.com. i want to use …

javascript regex preg-match
"preg_match(): Compilation failed: unmatched parentheses" in PHP for valid pattern

Wondering if anyone out there can shed some light on why the following regular expression is failing when used in …

php regex preg-match
PHP - preg_match and "Unknown modifier" error

I had that test that worked fine : if (ereg("([0-9]{2})[-./]([0-9]{2})[-./]([0-9]{4})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})", $dateToTest, $tab) == false) …

php regex preg-match ereg
Regex Optional Groups?

I seem to have confused myself with a preg_match regex I'm doing, so fresh eyes and help would be …

php regex preg-replace preg-match
Counterpart to PHP’s preg_match in Python

I am planning to move one of my scrapers to Python. I am comfortable using preg_match and preg_match_…

php python regex preg-match