Regexp to force line break/word wrap in long words

Regexp to force line break/word wrap in long words

am 03.12.2007 17:33:48 von cronoklee

Hi Can someone please give me a hand adapting this expression? I need
it to add a space into all words longer than 14 characters that are
not contained within [square brackets]

$result =3D preg_replace("/([^\s]{14})/","$1 ",$result);

It currently adds a space into all words that are longer than 14
characters but this is breaking another function I'm using which
extracts urls and other info from inside square brackets.

Thanks a lot!
Ciar=E1n

Re: Regexp to force line break/word wrap in long words

am 03.12.2007 23:12:29 von Paul Lautman

Ciaran wrote:
> Hi Can someone please give me a hand adapting this expression? I need
> it to add a space into all words longer than 14 characters that are
> not contained within [square brackets]
>
> $result = preg_replace("/([^\s]{14})/","$1 ",$result);
>
> It currently adds a space into all words that are longer than 14
> characters but this is breaking another function I'm using which
> extracts urls and other info from inside square brackets.
>
> Thanks a lot!
> Ciarán

I need more information to answer this, but no point in asking for it as I'm
sure in your expert view I have all Ineed!

Re: Regexp to force line break/word wrap in long words

am 04.12.2007 03:37:18 von Jerry Stuckle

Paul Lautman wrote:
>
> I need more information to answer this, but no point in asking for it as I'm
> sure in your expert view I have all Ineed!
>
>
>

;-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Regexp to force line break/word wrap in long words

am 04.12.2007 23:19:51 von cronoklee

On Dec 3, 10:12 pm, "Paul Lautman"
wrote:

> I need more information to answer this, but no point in asking for it as I'm
> sure in your expert view I have all Ineed!

Really?? What other information would you like? or were you just
trying to be condescending?

Re: Regexp to force line break/word wrap in long words

am 05.12.2007 02:50:20 von Jerry Stuckle

Ciaran wrote:
> On Dec 3, 10:12 pm, "Paul Lautman"
> wrote:
>
>> I need more information to answer this, but no point in asking for it as I'm
>> sure in your expert view I have all Ineed!
>
> Really?? What other information would you like? or were you just
> trying to be condescending?
>

No, just truthful. After several requests from different users, you told
us in comp.databases.mysql you didn't see why we would need any more
information to solve your problem.

With an attitude like that, don't expect people to be very helpful. We
aren't getting paid to do this. And quite frankly, I don't intend to
beg for the information I need, either.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Regexp to force line break/word wrap in long words

am 05.12.2007 03:13:23 von Courtney

Jerry Stuckle wrote:
> Ciaran wrote:
>> On Dec 3, 10:12 pm, "Paul Lautman"
>> wrote:
>>
>>> I need more information to answer this, but no point in asking for it
>>> as I'm
>>> sure in your expert view I have all Ineed!
>>
>> Really?? What other information would you like? or were you just
>> trying to be condescending?
>>
>
> No, just truthful. After several requests from different users, you told
> us in comp.databases.mysql you didn't see why we would need any more
> information to solve your problem.
>

That remninds me of the story of the man who said 'its pretty obvious if
you can read, it doesn't matter which way up you hold the book'

> With an attitude like that, don't expect people to be very helpful. We
> aren't getting paid to do this. And quite frankly, I don't intend to
> beg for the information I need, either.
>
That's the most creative way of saying "I can't answer you problem' I
have ever heard..

Re: Regexp to force line break/word wrap in long words

am 05.12.2007 03:48:00 von Jerry Stuckle

The Natural Philosopher wrote:
> Jerry Stuckle wrote:
>> Ciaran wrote:
>>> On Dec 3, 10:12 pm, "Paul Lautman"
>>> wrote:
>>>
>>>> I need more information to answer this, but no point in asking for
>>>> it as I'm
>>>> sure in your expert view I have all Ineed!
>>>
>>> Really?? What other information would you like? or were you just
>>> trying to be condescending?
>>>
>>
>> No, just truthful. After several requests from different users, you
>> told us in comp.databases.mysql you didn't see why we would need any
>> more information to solve your problem.
>>
>
> That remninds me of the story of the man who said 'its pretty obvious if
> you can read, it doesn't matter which way up you hold the book'
>
>> With an attitude like that, don't expect people to be very helpful.
>> We aren't getting paid to do this. And quite frankly, I don't intend
>> to beg for the information I need, either.
>>
> That's the most creative way of saying "I can't answer you problem' I
> have ever heard..
>

Nope, I could. But like Paul, I'm really not interested in helping him
with his attitude.

Why don't you help him?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Regexp to force line break/word wrap in long words

am 05.12.2007 12:41:10 von Courtney

Jerry Stuckle wrote:
> The Natural Philosopher wrote:
>> Jerry Stuckle wrote:
>>> Ciaran wrote:
>>>> On Dec 3, 10:12 pm, "Paul Lautman"
>>>> wrote:
>>>>
>>>>> I need more information to answer this, but no point in asking for
>>>>> it as I'm
>>>>> sure in your expert view I have all Ineed!
>>>>
>>>> Really?? What other information would you like? or were you just
>>>> trying to be condescending?
>>>>
>>>
>>> No, just truthful. After several requests from different users, you
>>> told us in comp.databases.mysql you didn't see why we would need any
>>> more information to solve your problem.
>>>
>>
>> That remninds me of the story of the man who said 'its pretty obvious
>> if you can read, it doesn't matter which way up you hold the book'
>>
>>> With an attitude like that, don't expect people to be very helpful.
>>> We aren't getting paid to do this. And quite frankly, I don't intend
>>> to beg for the information I need, either.
>>>
>> That's the most creative way of saying "I can't answer you problem' I
>> have ever heard..
>>
>
> Nope, I could. But like Paul, I'm really not interested in helping him
> with his attitude.
>
> Why don't you help him?
>

Because I myself am not afraid of saying 'I haven't a clue' but prefer
to keep my mouth shut when I haven't anything particularly constructive
to offer.

Which in this case, from now on, I will do.

Re: Regexp to force line break/word wrap in long words

am 06.12.2007 02:29:35 von cronoklee

On Dec 5, 2:48 am, Jerry Stuckle wrote:
>
> >> No, just truthful. After several requests from different users, you
> >> told us in comp.databases.mysql you didn't see why we would need any
> >> more information to solve your problem.

Jerry, Please be assured that I meant no offence to you or anyone else
over on the mysql newsgroup. You personally have been of great help to
me in the past and I am very thankful and respectful for that. I've
looked again at all the replies on the mysql topic and if you look
again you will see that I was nothing but polite and responsive until
I was asked to explain the table design repeatedly. I was looking for
a quick solution to a simple problem. The reason I did not give more
info initially was because I didn't want to start a long discussion on
the way my tables were laid out - I simply wanted help with the syntax
of the query. From experience posting to these newsgroups, I know that
giving too much superfluous info can lead to very delayed solutions as
eager purists discuss the most efficient way to do things. I usually
only post here to find handy solutions to problems I cannot fix and
occasionally to help beginners in similar situations. I was impatient
- I apologise and I do appreciate your time.
Ciar=E1n

Re: Regexp to force line break/word wrap in long words

am 06.12.2007 06:05:05 von Jerry Stuckle

Ciaran wrote:
> On Dec 5, 2:48 am, Jerry Stuckle wrote:
>>>> No, just truthful. After several requests from different users, you
>>>> told us in comp.databases.mysql you didn't see why we would need any
>>>> more information to solve your problem.
>
> Jerry, Please be assured that I meant no offence to you or anyone else
> over on the mysql newsgroup. You personally have been of great help to
> me in the past and I am very thankful and respectful for that. I've
> looked again at all the replies on the mysql topic and if you look
> again you will see that I was nothing but polite and responsive until
> I was asked to explain the table design repeatedly. I was looking for
> a quick solution to a simple problem. The reason I did not give more
> info initially was because I didn't want to start a long discussion on
> the way my tables were laid out - I simply wanted help with the syntax
> of the query. From experience posting to these newsgroups, I know that
> giving too much superfluous info can lead to very delayed solutions as
> eager purists discuss the most efficient way to do things. I usually
> only post here to find handy solutions to problems I cannot fix and
> occasionally to help beginners in similar situations. I was impatient
> - I apologise and I do appreciate your time.
> Ciarán
>

The problem was, the question you were asking required the tables design
to provide a good answer. And that's why you were asked for it
repeatedly, by multiple people.

Giving too much information is seldom bad. Not enough is *always* bad.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================