Questions tagged [posix-ere]

The POSIX Extended Regular Expression is the regex flavor used by the UNIX/Linux egrep command.

For more information about this regex flavor, see:

89 questions
0
votes
0 answers

POSIX extended regular expressions - search two words on separate lines

Please, help create a regular expression that looking for the word "aaa" and "llll" in the text (not in one line). Text example 1 (three lines): aaa bbbbb ccc jjj pppppppp mmmm fff ggg llll www zzzz Text example 2 (three lines): aaa bbbb…
0
votes
2 answers

php - valid regEx expression in ereg_replace makes nothing

I'm using PHP 5.2.17. I want to remove some surplus data from a JSON string and I've thought I can use some replace function to do so. Specifically I'm using ereg_replace with the next expression: '^.*?(?=\"created_at)' Which I've validated at…
0
votes
1 answer

convert ereg_replace to preg_replace in php

i have the following ereg_replace statement: ereg_replace ( ".*alternative0=\"[^\"]*\"[ ]{0,10}>", "", $v ); since ereg_replace is deprecated I would like to upgrade it to preg_replace and I also want to upgrade my code so only the first occurrence…
sd1sd1
  • 1,028
  • 3
  • 15
  • 28
0
votes
3 answers

PHP Regex for full names in a specific format

I'm trying to make a function to verify names on PHP using Regex, I want the names to be able to carry infinite amount of spaces and ' and -, and to allow only capital characters after spaces but to allow capital and none capitals after - and '..…
0
votes
3 answers

regex help, accepting range of hex characters

I wish to accept hex characters only, case doesn't matter, so [0-9a-fA-F] but I only want to accept strings between 10 and 64 characters, what is the best way to do this range? I am using POSIX Basic Regular Expressions.
Paul
  • 5,756
  • 6
  • 48
  • 78
0
votes
1 answer

split() PHP method changed with explode() but still gives me same error

I work on some php project for university. Need to create simple PHP chat client. I done that but in response file that do me split of string I have this message: I tried to change with explode() but it still gives me same error. Restarted apache…
Akosha
  • 471
  • 1
  • 10
  • 24
0
votes
1 answer

PHP - REG_BADBR error when using ereg() for regexp

I have this piece of code for email verification : function VerifRegisterEmail(&$email) { if(empty($email)) { return false; } $pattern_email = '^[[:alnum:]\.-_]+@[[:alnum:]\.-_]+\.[[:alpha:]]{2, 3}$'; …
Amokrane Chentir
  • 29,907
  • 37
  • 114
  • 158
0
votes
2 answers

RegEx syntax for ImageMagick "identify" within bash shell

I'm trying to run the ImageMagick identify command on a very large path of images where Identify returns the image dimensions of files that match a pattern. The pattern I'm trying to match…
jonaz
  • 2,096
  • 1
  • 17
  • 30
-1
votes
2 answers

grep string with alphanumeric and special character with a condition of 10 or more chars

We are trying to scan the list of files for the password. As per our requirement, password should contain alphanumeric with special character. Please help me with why this regex is not working ((\w*)([$%*@#]+)(\w+)){10,} Note: I will be using this…
Jenifer P
  • 1
  • 3
-1
votes
1 answer

Searching multiple URL pattern with Posix regex

I am trying to match a URL string with 100s of patterns against. I am using regcomp(). My understanding is I can club all these 100s of pattern into a single regex separated by () and can compile with single call of regcomp(). Is it correct? I tried…
Andy Garg
  • 31
  • 2
-1
votes
2 answers

weird php eregi behaviour in wamp and xampp

Recently I saw a problem in a simple code: $regexp =…
hpaknia
  • 2,769
  • 4
  • 34
  • 63
-1
votes
1 answer

How to convert a tricky ereg_replace to preg_replace?

I know there are lots of questions on that but i didn't found anything matches with my question. I want to convert this expression to preg_replace: $a = ereg_replace('[-a-z0-9!#$%&\'*+/=?^_`{|}~]+@([.]?[a-zA-Z0-9_/-])*','', $a); so far tried those…
mirza
  • 5,685
  • 10
  • 43
  • 73
-2
votes
1 answer

Which programming languages support posix-based regular expressions?

I know about re module in Python but it does not follow posix standard and PHP has removed ereg. Is there any library in any language which supports that? I think the closest is regex library in Java. Anyone knows about another? What would be the…
user8469305
-4
votes
1 answer

How to match only alphanumeric with regex

I'm trying to match alphanumeric with the regex below, but still matched the result that I don't need. ([0-9a-z_]+|[0-9a-z]+) What I really want to match are Example: abc123 abc_123 What I don't want to match are Example: abc 123 123_123 abc_abc
Deno
  • 434
  • 4
  • 16
1 2 3 4 5
6