CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
help using regex in Perl

 



RussianSpy
Novice

Oct 21, 2007, 12:20 PM

Post #1 of 1 (1829 views)
help using regex in Perl Can't Post

how can I use following in Perl (i found it here)?


Code
 (?x:	\(  # match the initial opening parenthesis	# Now make a named group 'balanced' which matches	# a balanced substring.	(?<balanced>		# A balanced substring is either something that is not a parenthesis:		[^()]		| # …or a parenthesised string:		\( # A parenthesised string begins with an opening parenthesis			\g<balanced>* # …followed by a sequence of balanced substrings		\) # …and ends with a closing parenthesis	)*  # Look for a sequence of balanced substrings	\)  # Finally, the outer closing parenthesis)



I tried it - $test =~ m/(?x:\((?<balanced>[^()]|\(\g<balanced>*\))*\))/; - but got:


Code
  

Sequence (?<b...) not recognized in regex; marked by <-- HERE in m/(?x:\((?<b <-
- HERE alanced>[^()]|\(g<balanced>*\))*\))/ at delme.pl line 4.

_________________________________________________
[ noobie alert ] WinXP :: Xitami Webserver :: Active Perl 5.8.6

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives