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: Intermediate:
Help with regex, not seeing \s!

 



AKiss20
New User

Jun 25, 2010, 11:29 AM

Post #1 of 2 (592 views)
Help with regex, not seeing \s! Can't Post

Hi all,

New to the forums and to Perl (and regex) so hello! I am trying to write a script that reformats names of conferences for a database. I am having some problems with the regex below


Code
(^.*\s(?!(formerly\s+\-\s+))(((symposium)|(conference)|(workshop)|(meeting))\s(o[n|f])\s*))


I want it to match for " symposium on testing" for example, but occasionally the titles have "(formerly - workshop on old testing)" at the end and that is matching when I don't want it to.

I can get it to match "symposium on" with no problem and even not match with formerly -workshop (no space between - and workshop) but whenever I put a last \s after formerly, it matches even when it shouldn't!

Please help, thanks

edit: sorry didn't see the regex forum!


(This post was edited by AKiss20 on Jun 25, 2010, 11:33 AM)


BillKSmith
Veteran

Jun 26, 2010, 8:00 PM

Post #2 of 2 (577 views)
Re: [AKiss20] Help with regex, not seeing \s! [In reply to] Can't Post

Why not use a second test on all lines that pass the first test? This is often much easier than getting one do-it-all RE correct.
Good Luck,
Bill

 
 


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

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