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:
trying to match Cryst-Cont : ++++_+++++| 0.9000


New User

May 11, 2006, 7:04 AM

Post #1 of 2 (5658 views)
trying to match Cryst-Cont : ++++_+++++| 0.9000 Can't Post

This is a field in a file containing experimental data which I am trying to parse using perl regex.

The delimiter between the field-name and the value is the ":"

Hence I am trying to do
my ($field, $value) = split($_, ":");

I want $field = Crystal-Cont and $value = '+++++_+++++ | 0.9000'.

However when I run my script it throws the following error
" Nested quantifiers in regex; marked by <-- HERE in m/ Cryst-Cont : ++ <-- HERE ++_+++++| 0.9000
/ at line 18 (#2)
(F) You can't quantify a quantifier without intervening parentheses. So things like ** or +* or ?* are illegal. The <-- HERE shows in the regular expression about where the problem was discovered.

Note that the minimal matching quantifiers, *?, +?, and
?? appear to be nested quantifiers, but aren't. See perlre "

Please advise me regarding the best way to eliminate this error.
Note that I cannot do a substitution or modify the $_ in any way.


Thaumaturge / Moderator

May 11, 2006, 8:36 AM

Post #2 of 2 (5656 views)
Re: [vishy64] trying to match Cryst-Cont : ++++_+++++| 0.9000 [In reply to] Can't Post

Looks to me like you have the arguments to split the wrong way round.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks


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

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