String processing - regex

casper2000a@REDACTED casper2000a@REDACTED
Tue Jun 14 10:21:49 CEST 2005


Hi Laurent,

Thanks a lot for your help/advice. It's working perfectly.

Cheers,
- Eranga



Quoting Laurent Picouleau : > Quoting Laurent Picouleau :

> Hi Eranga,
> 
> On Sat, 2005-06-11 at 02:52, casper2000a@REDACTED wrote:
> > Hi Laurent,
> > 
> > Thanks for the info. But I tried that too,
> > gregexp:groups(\"\",
> \"<\\\\(.+\\\\):\\\\(.+\\\\)[(]\\\\(.+\\\\)(,[\\s]*\\\\(.+\\\\))*[)]>\").
> > --> {match,[\"mod\",\"fun\",\"arg1\",\" arg2\",\" arg3\",\" arg5\",\"arg6\"]}
> > 
> > The result I get then have a space infront of arg2, arg3 and arg5. I want
> to get rid of any spaces in 
> > front. Ofcourse I can trim manually, but I\'m sure there must be a way to
> get that done in one parse 
> > using regexp.
> 
> This is more a regex problem than an erlang problem IMHO. You could do
> it like with this regex:
> \"<\\\\(.+\\\\):\\\\(.+\\\\)[(]\\\\(.+\\\\)(,[\\s]*\\\\([^ ]+\\\\))*[)]>\"
> ====
> 
> Here I\'ve used anything but space ( [^ ] ) but ideally you would like to
> have anything but \\s. See the documentation of this particular regex
> language to have the expected behaviour.
> 
> Br,
> 
> -- 
> Laurent Picouleau
> laurent.picouleau@REDACTED
> 
> 

--------------This mail sent through OmniBIS.com--------------




More information about the erlang-questions mailing list