I actually have two questions but they are almost the same thing. no1, I want to use PHP to check if a variable contains anything that is not a forward slash or a number, I am aware that I can use …
Tag: regex
how do i allow space in regex in mod_rewrite engine
i have a regex that i want it to allow white spaces. this regex i am using is in the .htaccess file. whenever i put the s it makes the whole regex not work what can i do to make it allow white spaces and work? this is my regex: this is my full rewrite rule, when i put s
Get index of first dot with letter in a string
I have a string like this one: dsl-34.345.324-24718.pool.vodafone9.com (not a real hostname, just an example) I’ve already tinkered around with preg_split which didn’t gave me the good result. Anyway, …
Check if string have specific number of symbols
In trying to figure out how to do it with preg_match, but I’m left with no clue. So what I’m trying is Answer I know you said preg_match, but there is a specific PHP function for this. Use substr_count() 🙂
PHP – Password RegEx requirements
I am trying to validate if a new user account’s password is matching these criterias: Between 8-30 characters long Contains at least 1 lowercase letter (a-z) Contains at least 1 uppercase letter (A-Z)…
Regex: how to add a capture group?
I currently have this regex: [(?:w+*?s+)?([^][]+)] I want to add another capture group, so I can capture the text value before the groups. For example: Je naam (verplicht) [text* your-test] …
Match a pattern by ignoring different brackets
I have a string and I would like to know the first position of a pattern. But it should be found only, if it’s not enclosed by with brackets. Example String: “This is a (first) test with the first …
PHP (regex): Extract column names from SQL-Query
I am struggling with a regular expression in PHP: I have a number of SQL-queries. Now, I’d like to extract the variable names (column names) within these queries. It should return an array (…
PHP Replace URLs in string with Anchor tag
I’m trying to parse a string that contains links in it. I’m happy to specify the format that they come across in, however normal HTML tags are being stripped out in transit. I’m suggesting the …
Regex for FIGI numbers
I am trying to write some regex to match FIGI numbers. FIGI numbers have 12 characters and are built in the following structure: A two-letter prefix, excluding (BS, BM, GG, GB, GH, KY, VG) G as the …