preg-match-all Questions

2

Solved

How would I use PHP to extract everything in between [startstring] and [endstring] from this string: [startstring]hello = guys[endstring] hello guys [startstring]jerk = you[endstring] welcome to t...
Sequela asked 13/1, 2013 at 21:6

2

Solved

I have preg_match_all function: preg_match_all('#<h2>(.*?)</h2>#is', $source, $output, PREG_SET_ORDER); It's working as intended, BUT the problem is, it preg_matches all items twice ...
Ulcer asked 14/11, 2012 at 5:41

1

Solved

I've managed to get part of the preg_match returning the values I need, but am unable to get the correct syntax to return what follows that string after a comma. Any assistance is appreciated - tha...
Stereotypy asked 26/7, 2012 at 18:27

2

Solved

This is a really simple problem, but I couldn't find a solution anywhere. I'm try to use preg_match or preg_match_all to obtain a string from within parentheses, but without the parentheses. So f...
Potentilla asked 28/6, 2012 at 16:56

3

Solved

I want to find (if they exist) any hash tags and get the first co-occurrence of each tag plus the text after it but before the next tag if another exists. *Not all message strings carry a hash tag...
Aeroneurosis asked 21/6, 2012 at 12:30

3

Solved

I have this string @[123:peterwateber] hello there 095032sdfsdf! @[589:zzzz] I want to get 123 and 589 how do you that using regular expression or something in PHP? Note: peterwateber and z...
Pointenoire asked 6/5, 2012 at 5:23

1

Solved

Possible Duplicate: Regular Expression to match outer brackets I have a string of the following format: (((aaa (bbb) ccc)(ddd (eee) fff) ggg)(hhh (iii) )(jjj (kkk) lll) mmm)(nnn (ooo...
Kirbie asked 28/4, 2012 at 7:34

7

Solved

I'm just getting to know regular expressions, but after doing quite a bit of reading (and learning quite a lot), I still have not been able to figure out a good solution to this problem. Let me be...
Contaminant asked 22/4, 2012 at 22:16

3

Solved

mmmh guys, i really hope my english is good enaught to explain what i need. Lets take this example (that is just an example!) of code: class Something(){ public function Lower($string){ return ...

1

Solved

<? function recursiveSplit($string, $layer) { $err = preg_match_all("/\{(([^{}]*|(?R))*)\}/",$string,$matches); echo "Elementi trovati: $err<br>"; if($err == FALSE)...
Para asked 13/3, 2012 at 20:31

2

Solved

Why does the following evaluate to true? if(preg_match_all('%<tr.*?>.*?<b>.*?</b>.*?</tr>%ims', $contents, $x)===FALSE) {...} $contents, is retrieved using file_get_content...
Themselves asked 2/2, 2012 at 23:32

4

Solved

I have the following regex that I have been using successfully: preg_match_all('/(\d+)\n(\w.*)\n(\d{3}\.\d{3}\.\d{2})\n(\d.*)\n(\d.*)/', $text, $matches) However I have just found that if the te...
Cush asked 15/11, 2011 at 13:47

6

Solved

I have a string: This is a text, "Your Balance left $0.10", End 0 How can I extract the string in between the double quotes and have only the text (without the double quotes): Your Balance ...
Microbalance asked 19/6, 2009 at 9:17

2

Solved

I am trying to get the information out of this array, but for some reason it is nesting everything into $matches[0]. <? $file = shell_exec('pdf2txt.py docs/April.pdf'); preg_match_all('/.../...
Exophthalmos asked 19/5, 2011 at 5:59

4

Solved

i wonder what is the problem with the backreference here: preg_match_all('/__\((\'|")([^\1]+)\1/', "__('match this') . 'not this'", $matches); it is expected to match the string between __('') b...
Kaykaya asked 18/5, 2011 at 20:9

3

Solved

I am transitioning from php to ruby and I am trying to figure the cognate of the php commands preg_match_all and preg_replace in ruby. Thank you so much!
Marotta asked 26/4, 2011 at 14:19

2

Solved

I've some troubles using Preg_replace and preg_match_all to convert a Youtube URL to embed code. Yes, I know that this topic has already touched in stackoverflow but not exactly like I want. I can...
Gallaway asked 17/1, 2011 at 12:48

1

This is the regex I'm trying to use: /^(\w|\.|-)+?@(\w|-)+?\.\w{2,4}($|\.\w{2,4})$/gim I found it on this site, and it works great when I try it out there. But as soon as I place it in my code, ...
Ostracize asked 26/8, 2010 at 19:18

2

Solved

I have a string, such as this: $foo = 'Hello __("How are you") I am __("very good thank you")' I know it's a strange string, but stay with me please :P I need a regex expression that will look ...
Sikko asked 9/3, 2010 at 19:10

© 2022 - 2024 — McMap. All rights reserved.