Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Add a word break to long words...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ciaran  
View profile  
 More options May 27, 8:32 am
From: Ciaran <cronok...@hotmail.com>
Date: Wed, 27 May 2009 05:32:21 -0700 (PDT)
Local: Wed, May 27 2009 8:32 am
Subject: Add a word break to long words...
Hi I'm trying to write a regexp that adds a <wbr> word break tag to
all words in a html string that are longer than 10 characters. The
problem is the regexp match needs to ignore all strings inside < and >
as they are obviously part of the code itself.
Here's what I have so far but it doesn't seem to match correctly:

(?<!<)(\S{10,200})(?!>)

By the way, I'm using this site a lot lately which is very cool for
regex beginners:
http://gskinner.com/RegExr/

Thanks a lot,
Ciarán


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cronoklee  
View profile  
 More options May 29, 11:24 am
From: cronoklee <cronok...@hotmail.com>
Date: Fri, 29 May 2009 08:24:54 -0700 (PDT)
Local: Fri, May 29 2009 11:24 am
Subject: Re: Add a word break to long words...
Here's some sample search text.

<br /><br />This is a test message with <a href="http://
groups.google.ie/group/regex/browse_thread/thread/
7e0975969ecfc420">■ long links</a> and people doing annoying
things like
COOL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<br /><h2>or</
h2>yeeeeeeeeeeeeyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
which destroys <i>my layout</i>

Cheers,
Ciarán


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cronoklee  
View profile  
 More options Jun 11, 9:26 am
From: cronoklee <cronok...@hotmail.com>
Date: Thu, 11 Jun 2009 06:26:12 -0700 (PDT)
Local: Thurs, Jun 11 2009 9:26 am
Subject: Re: Add a word break to long words...
Anyone?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugeny Sattler  
View profile  
 More options Jun 17, 3:46 am
From: Eugeny Sattler <eugeny.satt...@gmail.com>
Date: Wed, 17 Jun 2009 12:46:14 +0500
Local: Wed, Jun 17 2009 3:46 am
Subject: Re: Add a word break to long words...
Hi,
sorry for late reply...though....
Try this approach

#free spacing regex
</[a-z][0-9]?>   #closing html tag, used just as a milestone
(.(?<!\<))+      #any char but not the one that has "<" to
                 #the left of it, repeated many times, thus
                 #making a loooong word
<[a-z][0-9]?>    # opening html tag, used just as a milestone

this one catches this snippet from your example

</h2>yeeeeeeeeeeeeyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
which destroys <i>

Note: i deleted line breaks from your text before applying my regex

--
Regards, Eugeny

--
best regards,          Eugeny

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cronoklee  
View profile  
 More options Jun 19, 11:17 am
From: cronoklee <cronok...@hotmail.com>
Date: Fri, 19 Jun 2009 08:17:29 -0700 (PDT)
Local: Fri, Jun 19 2009 11:17 am
Subject: Re: Add a word break to long words...

On Jun 17, 8:46 am, Eugeny Sattler <eugeny.satt...@gmail.com> wrote:

Great, Thanks for the reply. At first glance it looks good but it
should catch all long words that are not between html <braces>. So it
should also catch "COOL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" from my
sample. I'll have a look at it properly and let you know anyway.
Thanks again,
Ciarán

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google