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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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



Oct 21, 2007, 12:20 PM

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

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

 (?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:


Sequence (?<b...) not recognized in regex; marked by <-- HERE in m/(?x:\((?<b <-
- HERE alanced>[^()]|\(g<balanced>*\))*\))/ at 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