Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have a string which contain
$mystring = "------------------------
------------------------
<p>
<pre><small>
MessageID=542E7A07, Recipient=1111111111
</small></pre>
------------------------
------------------------";
I would like to get the MessageID and Recipient No. using the regular expression.
MessageID=([a-zA-Z0-9]+)|Recipient=([0-9]+)
You can try this.Grab the matches or captures.See demo.
http://regex101.com/r/sU3fA2/2
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Kindly help on below preg_match.
MDR0123456789 - First three char should be MDR and 9 digit number.
MDR-OPX - Three character hypen three character.
^MDR[0-9]{9}$
^MDR\-[A-Za-z]{3}$
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have code like this
function get_id(){
return 1;
//
}
I want to remove all // inside the source code, but only those stand by it own, on a newline just like the example here. Nothing much nothing more. How can I do it?
Search using this regex:
^\s*\/\/\s*$
and replace by empty string.
If using PHP you can use \h (horizontal space) instead of \s:
$code = preg_replace('~^\h*//\h*$~m', '', $code);
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have this code.
<?php echo "".$row['pname']."";?></h4>
When I click on the link,Its only posting the first word of the string,the rest are ignored
Missing the quotes for href attribute -
echo "<a href='pvendors.php?post=".$par."'>".$row['pname']."</a>";
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Laravel
What mistake am I actually doing?
Please have a look at the image below:
http://1drv.ms/1ybX4Cg
I think
$body['user_id'] = $user()->id;
should be
$body['user_id'] = $user->id;
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I would like to split a string from a whole string which has two delimiters. For example
String1= ABC*WELCOME*CDF
I should get out put as WELCOME.
Note: Delimiters can be any position of the string(not static) but I need only string between those two delimiters
Thanks in advance.
$String1 = 'ABC*WELCOME*CDF';
list( ,$myString, ) = explode('*',$String1);
echo $myString;