Regular Expression help... 
Author Message
 Regular Expression help...

Given a string with some of the words in curly braces, how do I
extract the words within curly braces alone using regular expression?
Also I wouldnt know how many such words within braces exist in my
string...In such a case how do i extract all the words.

$str = "My {name} is {anand} and i seek {your} help in this
{problem}";

Anand,



Sun, 25 Dec 2005 16:48:13 GMT  
 Regular Expression help...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Quote:
> Given a string with some of the words in curly braces, how do I
> extract the words within curly braces alone using regular expression?
> Also I wouldnt know how many such words within braces exist in my
> string...In such a case how do i extract all the words.

> $str = "My {name} is {anand} and i seek {your} help in this
> {problem}";

Pretty straightforward:


- --
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPwvq9WPeouIeTNHoEQItDQCeI/yaVs4b6DGT9OoIqk0gBnRPrUoAoOhP
AS1OnpTX8q7DQ0mPNWHJwpdH
=WVph
-----END PGP SIGNATURE-----



Sun, 25 Dec 2005 18:14:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Complicated regular expression help

2. Regular expression HELP.

3. Regular expressions help (NEWBIE)

4. Regular expression help

5. Regular expression help

6. Regular expression help please

7. Regular Expression Help

8. Dumb Regular Expression Help - Getting a Filename

9. regular expression help

10. Regular Expression Help

11. regular expression help

12. Requesting regular expression help

 

 
Powered by phpBB® Forum Software