Result is the same, Space is not getting created when i used
But space will get created when i used the exact expression , something like this.
But this expression ns1 changes in many of the scenarios, so instead of this I need to use Regex. Can you get me the exact regex that needs to be used.
Problem: I have a shell script that will be called by a Perl module that will connect to a db and delete rows. The Perl module will be called by CRON. I am using a Perl module to call a shell script because I need to get the db connection from Perl.
Here is the Perl pseudocode:
... (4 Replies)
I'm trying to grep a long ls by looking at the beginning of each filename for example:
Many files begin with yong_ho_free_2005...
Many files begin with yong_ho_2005...
I can't just use "grep yong_ho" otherwise It'll display both files.
So I'm trying to use a regex but my syntax is wrong.
... (2 Replies)
Iam a learner of UNIX. Fortunately I got this site.
I want to check the file for its existance.
if
echo " Not present"
else
echo "Present"
fi
The above code is working fine. But I also want to check for the files which are compressed.
I tried the following code and it is not... (5 Replies)
Dear all
I am still bit new in shell script area.I am writing down a shell script which I guess somewhere wrong so please kindly correct it. I would be greatful for that.
What I actually want from this shell script is that it will move all the files one by one to another server which can be... (2 Replies)
i've looked at a bunch of the date comparison threads on these boards but unfortunately not been able to figure this thing out yet. still confused by some of the way conditionals handle variables...
here is what i where i am now...
# a bunch of initializition steps are here ...... (1 Reply)
I am trying to write a simple if statement but that driving me crazy:eek: with syntactical erorrs.
This is what I managed to come up
#!/bin/ksh
USERNAME=`whoami`
if ;then
echo " you have logged in as report user"
elif ; then
echo " you have logged in as extract user"
else " I dont... (3 Replies)
Hi,
I want to check if file(s) exist even in subdirectories and perform an action. After searching here couldn't find solution that would work, but made my own solution that works fine:
if
then
echo
egrep "$1|$2|$3" `find| grep MLOG`
else
echo "MLOG does not exist"
fiThat will check... (1 Reply)
I have a file name :
var=UsrAccChgRpt
I want to make them upper case.
Tried:
$var | tr
Error:
tr: Invalid combination of options and Strings.
Usage: tr | -ds | -s | -ds | -s ] String1 String2
tr { -d | -s | -d | -s } String1
Could you please help. I am using AIX... (2 Replies)
Hello,
Using Bash on Mac OS X 10.7.5 (Lion). I downloaded a GrowlSafari plugin for Webkit from its GitHub page GitHub - uasi/growl-safari-bridge: GrowlSafariBridge enables arbitrary javascript (including Safari Extensions) to notify via Growl.. In the description it says that after installing for... (0 Replies)
I need to find all files and folders containing keyword from the topmost directory deep down the tree but omitting all references to keyword in web-search logs and entries, i.e. excluding search and browsing history made using web-browser1, web-browser2, web-browser3, (bypassing all entries of the... (8 Replies)
Discussion started by: scrutinizerix
8 Replies
LEARN ABOUT PHP
mb_regex_set_options
MB_REGEX_SET_OPTIONS(3) 1 MB_REGEX_SET_OPTIONS(3)mb_regex_set_options - Set/Get the default options for mbregex functions
SYNOPSIS
string mb_regex_set_options ([string $options = mb_regex_set_options()])
DESCRIPTION
Sets the default options described by $options for multibyte regex functions.
PARAMETERS
o $options
- The options to set. This is a string where each character is an option. To set a mode, the mode character must be the last one
set, however there can only be set one mode but multiple options.
Regex options
+-------+-------------------------------+---+---+
|Option | | | |
| | | | |
| | Meaning | | |
| | | | |
+-------+-------------------------------+---+---+
| i | | | |
| | | | |
| | Ambiguity match on | | |
| | | | |
| x | | | |
| | | | |
| | Enables extended pattern form | | |
| | | | |
| m | | | |
| | | | |
| | | | |
| | '.' matches with newlines | | |
| | | | |
| s | | | |
| | | | |
| | | | |
| | '^' -> 'A', '$' -> '' | | |
| | | | |
| p | | | |
| | | | |
| | Same as both the m and s | | |
| | options | | |
| | | | |
| l | | | |
| | | | |
| | Finds longest matches | | |
| | | | |
| n | | | |
| | | | |
| | Ignores empty matches | | |
| | | | |
| e | | | |
| | | | |
| | eval(3) resulting code | | |
| | | | |
+-------+-------------------------------+---+---+
Regex syntax modes
+-----+----------------------------+---+---+
|Mode | | | |
| | | | |
| | Meaning | | |
| | | | |
+-----+----------------------------+---+---+
| j | | | |
| | | | |
| | Java (Sun java.util.regex) | | |
| | | | |
| u | | | |
| | | | |
| | GNU regex | | |
| | | | |
| g | | | |
| | | | |
| | grep | | |
| | | | |
| c | | | |
| | | | |
| | Emacs | | |
| | | | |
| r | | | |
| | | | |
| | Ruby | | |
| | | | |
| z | | | |
| | | | |
| | Perl | | |
| | | | |
| b | | | |
| | | | |
| | POSIX Basic regex | | |
| | | | |
| d | | | |
| | | | |
| | POSIX Extended regex | | |
| | | | |
+-----+----------------------------+---+---+
RETURN VALUES
The previous options. If $options is omitted, it returns the string that describes the current options.
SEE ALSO mb_split(3), mb_ereg(3), mb_eregi(3).
PHP Documentation Group MB_REGEX_SET_OPTIONS(3)