I am working on a MySQL database and noticed that it doesn't natively support PCRE (requires a plugin).
I wish to use these three for some data validation (these are actually the values given to the pattern attribute):
^[A-z\.…
ereg and eregi functions will be deleted from Php. Please help to find alternatives for the following ereg functions:
1) To allow IP addresses only for specific ranges:
$targetAddr = "60.37..*..*";
if (!ereg($targetAddr, $_SERVER['REMOTE_ADDR']))…
I have two string variables which are both file paths. The code that worked used ereg which is deprecated, so I'm trying to rewrite it using preg_match:
Old code that worked:
$path1 = quotemeta($path);
ereg("$path1(.*)$", $path2, $matches);
Using…
what is the regular expression for showing whole line if it contains particular string?
source string is "ABC: i am your father" and I need to show everything on the line after "ABC:" so the final output is "i am your father".
Thanks.
I've seen a solution for not having to rework usage of the ereg function for PHP 5.3:
Good alternative to eregi() in PHP
It uses if(!function_exists....
Is there a function that can be used in this way for…
A couple of PHP ereg_replace questions. I have an array of names:
$ssKeywords = array("Str", "Int", "String", "As", "Integer", "Variant");
However when I use this ereg_replace:
foreach($arKeyword as $aWord) {
$sCode = ereg_replace($aWord, "
While working on an embedded project; during changing of the scheduling policy from SCHED_OTHER to SCHED_RR I am getting timer issues and stream loading delays. Some issues are not coming during SCHED_OTHER but arriving at SCHED_RR(round robin).…
I have written the following regex:
^project\(.+?version\s*:\s*'(.+?)'.*\)$
The first capture group will grab 0.9.20 from the following block of text:
project(
'waybar', 'cpp', 'c',
version: '0.9.20',
license: 'MIT',
meson_version:…
I'm working to create some regex entries that are well-formed, and efficient. I'll place an emphasis on efficient, as these regex entries can see thousands of logs per second. Inefficient regex entries can cause severe performance impacts.
Question:…
I've been trying to convert a unicode regex to POSIX regex to remove \p{So} , \p{Cs}, \p{Cn} and \x1A type of characters from a column.
In Informatica I was using reg_replace (col_name,'[\p{So}\p{Cs}\p{Cn}\x1A]',' ') function to filter out these…
I need a regular expression in POSIX ERE format (for MySQL) to match any single standing character (between 2 spaces) in a string :
"abc d e f ghi" should match to "d e f"
I have only very basic knowledge of regular expressions (in PHP) and can't…
The POSIX standard states that for both ERE and BRE:
Consistent with the whole match being the longest of the leftmost matches, each subpattern, from left to right, shall match the longest possible string. For this purpose, a null string shall be…
I'm getting strange results when I try to find and replace curly quotes inside a character class, with another character:
sed -E "s/[‘’]/'/g" in.txt > out.txt
in.txt: ‘foo’
out.txt: '''foo'''
If you use a as a replacement, you'll get aaafooaaa.…
I'm fairly new to RegEx and am trying to extract following values from key:value pairs in the following text -
Values to be extracted -
RDU5
String -
"stopCode":"RDU5"
I'm using following expression -
((?<=stopCode\":\").*?(?="))
This RegEx works…
I am using Snowflake database and hope to find a single expression that will find and replace multiple items. The column in question has rows containing, Y, Yes, N, NO, and other irrelevant strings. So, in the example below Y and Yes are replaced…