Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mb_ereg_search_init(3) [php man page]

MB_EREG_SEARCH_INIT(3)							 1						    MB_EREG_SEARCH_INIT(3)

mb_ereg_search_init - Setup string and regular expression for a multibyte regular expression match

SYNOPSIS
bool mb_ereg_search_init (string $string, [string $pattern], [string $option = "msr"]) DESCRIPTION
mb_ereg_search_init(3) sets $string and $pattern for a multibyte regular expression. These values are used for mb_ereg_search(3), mb_ereg_search_pos(3), and mb_ereg_search_regs(3). PARAMETERS
o $string - The search string. o $pattern - The search pattern. o $option - The search option. RETURN VALUES
Returns TRUE on success or FALSE on failure. NOTES
Note The internal encoding or the character encoding specified by mb_regex_encoding(3) will be used as the character encoding for this function. SEE ALSO
mb_regex_encoding(3), mb_ereg_search_regs(3). PHP Documentation Group MB_EREG_SEARCH_INIT(3)

Check Out this Related Man Page

MB_EREG_REPLACE(3)							 1							MB_EREG_REPLACE(3)

mb_ereg_replace - Replace regular expression with multibyte support

SYNOPSIS
string mb_ereg_replace (string $pattern, string $replacement, string $string, [string $option = "msr"]) DESCRIPTION
Scans $string for matches to $pattern, then replaces the matched text with $replacement PARAMETERS
o $pattern - The regular expression pattern. Multibyte characters may be used in $pattern. o $replacement - The replacement text. o $string - The string being checked. o $option - Matching condition can be set by $option parameter. If i is specified for this parameter, the case will be ignored. If x is specified, white space will be ignored. If m is specified, match will be executed in multiline mode and line break will be included in '.'. If p is specified, match will be executed in POSIX mode, line break will be considered as normal character. If e is specified, $replacement string will be evaluated as PHP expression. RETURN VALUES
The resultant string on success, or FALSE on error. NOTES
Note The internal encoding or the character encoding specified by mb_regex_encoding(3) will be used as the character encoding for this function. Warning Never use the e modifier when working on untrusted input. No automatic escaping will happen (as known from preg_replace(3)). Not taking care of this will most likely create remote code execution vulnerabilities in your application. SEE ALSO
mb_regex_encoding(3), mb_eregi_replace(3). PHP Documentation Group MB_EREG_REPLACE(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to search for a str and replace it..

in my file, i like to search for a string and if there is a match then i want to replace it with someother string(like in windows wordpad). i only know how to search for a pattern.... but i dont know how to replace it.. and 1). i think it is there in unix grep or some other commends... if... (6 Replies)
Discussion started by: sekar sundaram
6 Replies

2. UNIX for Dummies Questions & Answers

search pattern in a string and rename

Hi All, I have a string assigned to a variable. the string will be a filename. Something like below: file=testfile.dat.20009080_{arc}_2004809090 I need to check if the filename has a pattern like "_{arc}_" and if so I have to rename the file like below mv... (6 Replies)
Discussion started by: deepakgang
6 Replies

3. UNIX for Dummies Questions & Answers

How to search for a pattern a string?

Hi all, I'm new in UNIX , so how to check if stringA is present within stringB ? Something similar to INSTR function in pl sql... Thanks a lot. (12 Replies)
Discussion started by: Leo_NN
12 Replies

4. UNIX for Dummies Questions & Answers

Print lines between the search pattern

hi, I have a file say x.txt containing xxx 123 bla bla ... you xxx dfk dbf ... me xxx ... ... keeps on.. i need to search for pattern in the line starting xxx in the file. If pattern matched, I need to fetch all the lines till i find next xxx. (17 Replies)
Discussion started by: prsshini
17 Replies

5. Shell Programming and Scripting

How to insert a character in line in Special condition?

Hi, I have a log file generated by a tool which has the following look : /tmp/releases/directory/datefilename1_release_date.zip /tmp/releases/directory/datefilename2_release_date.zip /tmp/releases/directory/datefilename3_release_date.zip... (8 Replies)
Discussion started by: bhaskar_m
8 Replies

6. UNIX for Dummies Questions & Answers

How to search all the files in a directory for a specific string

Hi Guys, I want to search the content of all the files (of a particular type like .txt) in a directory for a specific string pattern. Can anyone help me? Thanks (7 Replies)
Discussion started by: mwrg
7 Replies

7. Shell Programming and Scripting

awk + pattern search with regular expression

Hi , I have a file with "|" (pipe) as a delimeter. I am looking for the record count where 5th field is a number with 15 digit length only. all the records with above requirement is valid rest all are invalid. I need count of valid records and invalid records. Can anyone please help (9 Replies)
Discussion started by: vikash_k
9 Replies

8. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

9. UNIX for Dummies Questions & Answers

pattern containg ' search and replace

Hi guys I'm new to this forum so please help me in this I have a file where i need to replace a pattern value=' ' with the pattern value='abc' and moreover that abc value must be passed from some variable say i assign name=abc and use name as the value to replace instead of the direct string... (10 Replies)
Discussion started by: sundarj
10 Replies

10. Shell Programming and Scripting

Searching for multiple patterns in a file

Hi All, I have a file in which i have to search for a pattern from the beginning of the file and if the pattern is found , then i have to perform a reverse search from that line to the beginning of the file to get the first occurrence of another pattern. sample input file hey what are you... (8 Replies)
Discussion started by: Kesavan
8 Replies

11. Shell Programming and Scripting

Awk - find string, search lines below string for other strings

What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info. Basically my file looks like this: ...... (6 Replies)
Discussion started by: Mbohmer
6 Replies

12. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

13. Shell Programming and Scripting

How to search pattern and add that pattern in next line

Hi All, I am new to shell scripting and need help in scripting using CSH. Here is what I am trying to so, 1. Search a specific string e.g. "task" from "task (input1, out1)". 2. Extract the arguements "input1" and "out1" 3. Add them in separate lines below. eg. "int input1" , " integer out1" ... (7 Replies)
Discussion started by: deshiashish
7 Replies

14. Shell Programming and Scripting

[SOLVED] Replace a string in nextline after searching a pattern

Hi, I have a requirement where I need to replace a string in a line and this line will be identified by search criteria on previous line: E.g.: I have an xml file and Contents as below: <Root> <NameValue> <name>Global/Text/Data</name> <value>This is valid... (14 Replies)
Discussion started by: mailing2vamsi
14 Replies

15. UNIX for Dummies Questions & Answers

Help with if then sentence (string in file)

Hello! I'd like some help with a sentance, this 'if' should take a string from the user, then search my list for that string, now only those lines that string is found should be worked on. I'm new to this, but i'm guessing it's something like this.. #!/bin/bash ... (10 Replies)
Discussion started by: klskl
10 Replies