replace space in text without affecting html tags - html

I need to replace the space inside the html by , but without affecting the spaces inside of .
So that something like this: Hello <font color="red"> How Are <font color="black"> You?
would become this: Hello <font color="red"> How Are <font color="black"> You?
It changes the spaces outside of the tags, but the spaces inside the tags aren't affected.
I have tried this sample code that was suggested by someone:
NSString *string = originalHTMLString;
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:#"(?i)(<script(?:[^>\"']|\"[^\"]*\"]|'[^']*')*>)\s+</script\\s*>|<style(?:[^>\"']|\"[^\"]*\"]|'[^']*')*>)\s+</style\\s*>|<textarea(?:[^>\"']|\"[^\"]*\"]|'[^']*')*>)\s+</textarea\\s*>|</?[a-z](?:[^>\"']|\"[^\"]*\"]|'[^']*')*>|\\S+)|\\s+" options:NSRegularExpressionCaseInsensitive error:&error];
NSString *modifiedString = [regex stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, [string length]) withTemplate:#" "];
finalHTMLString = modifiedString;
But it didn't work. Just returned Null, I think the RegEx pattern is wrong.
This is some sample html I have to convert:
<samp class="s22">من مشاكل جرّأء العثّ والفيروسات منذ سنوات. إلاّ أنّ أمرًا ما حدث في الأعوام الماضية وسبّب المشكلة".</samp></p> <p class="mytext-19" dir="RTL"><samp class="s20">ويعتقد هاكينبرغ أنّ الأمر بدأ منذ عام </samp><samp class="s21">2004</samp><samp class="s22">. ففي أيار ذلك العام، اشتكى مزارعو العنبيّة في ماين من أنّ نحلهم الذي يلقّح محصولهم كان يُنتج طرودًا ويغادر الخلايا. كما أنّ نحل الخلايا الأخرى لا يسرق العسل الموجود في الخليّة المتروكة.</samp></p> <p class="mytext-19" dir="RTL"><samp class="s20">وحين بحث عن تفسير لهذا السلوك الغريب، اكتشف أنّ مزارعي التفاح في واشنطن استعملوا مبيدًا جديدًا يحتوي على النيونيكوتينوييد يُدعى </samp><samp dir="LTR">Assail</samp><samp class="s22"> لأشجارهم. وكان نحله يلقّح تلك الأشجار في الربيع.</samp></p> <p class="mytext-19" dir="RTL"><samp class="s20">ذاك الشتاء (</samp><samp class="s21">2004</samp><samp class="s22">-</samp><samp class="s21">2005</samp><samp class="s22">)، خسر ثلثَ نحله تقريبًا، وهي نسبة أعلى بكثير من المعتاد. وفي العام التالي نفق النصف كما أُبلغ عن خسائر في مختلف أنحاء البلاد.</samp></p> <p class="mytext-19" dir="RTL"><samp class="s20">يقول هاكنبيرغ: "لقد ساءت الأمور جدًّا، ولكنّ أحدًا لم يتمكّن <samp class="s37">من معرفة السبب". لهذا، ففي صيف عام </samp></samp><samp class="s61">2006</samp><samp class="s38"> عقد اجتماعًا مع علماء في نبراسكا ليحاول إيجاد سبب للارتفاع السريع في معدّل نفوق </samp><samp class="s26">النحل. "قيل إنّ الاجتماع ضمّ أذكى العقول ولكنّنا جلسنا ليومين نتباحث من دون التوصّل لشيء". وبعد بضعة أشهر هلك ثلثا ما تبقّى من نحله.</samp></p> <p class="mytext-19" dir="RTL"><samp class="s20">أعطى النحّالون الذين نقلوا </samp><samp class="s21">1</samp><samp class="s22">.</samp><samp class="s21">2</samp><samp class="s22"> مليون قفير إلى بساتين اللوز في كاليفورنيا في شباط أوّل مؤشر على صحة النحل عام </samp><samp class="s21">2008</samp><samp class="s22">. لم تكن الإشارات جيّدة. <a class="MyAppHighlight1" style="background-color:pink; color:black;" name="M10">فمن بين الاثني عشر نحّالاً تقريبًا الذين تحدثنا إليهم</a>، اثنان منهم فقط دخلوا الشتاء سالمين نسبيًّا. أمّا الباقون فخسروا ما يتراوح بين </samp><samp class="s21">30</samp><samp class="s22"> بالمئة و</samp><samp class="s23">60</samp><samp class="s22"> بالمئة من قفرلوا الشتاء سالمين نسبيًّا. أمّا الباقون فخسروا ما يتراوح بين </samp><samp class="s21">30</samp><samp class="s22"> بالمئة و</samp><samp class="s23">60</samp><samp class="s22"> بالمئة من قفر\330انهم بما بدا شبيهًا بداء <samp class="s37">انهيار الخليّة. ومن بين عمليات الهجرة الاثنتي عشرة التي تابعتها وزارة </samp>الزراعة الأميركيّة من أيلول <samp class="s37">العام </samp></samp><samp class="s21">2007</samp><samp class="s22"> وحتّى ربيع <samp class="s37">العام </samp></samp><samp class="s21">2008</samp><samp class="s22">، ظهر في خمس </samp><samp dir="LTR" class="s2"><span style="display:none;">00002</span> </samp><a style="color:transparent;" name="00003"></a><samp><span style="display:none;">00003</span></samp></p> <p class="bigtitle"> </p> <p class="bigtitle"> </p> <p class="bigtitle-3" dir="RTL"><samp class="s4">عَالَمٌ بِلا نَحْل</samp></p> <p class="bigtitle-3" dir="RTL"><samp dir="LTR" class="s5">A World Without Bees</samp></p> <p class="mo2allef"> </p> <p class="mo2allef"> </p> <p class="smallertitleCxSpFirst-6" dir="RTL"><samp class="s7">تأليف</samp><samp class="s8">:</samp></p><p> </p>
Thank you for your assistance.

This isn't a RegEx answer, but in Objective-C this should take a string called originalHTML, switch out all of the spaces outside of tags, and save it as a string called finalHTML
NSString *originalHTML = #"Your backslashed HTML Here";
NSString *finalHTML = [[NSMutableString alloc] init];
BOOL insideTag = NO;
BOOL convertSpace = NO;
for (int i = 0; i < originalHTML.length; i++) {
unichar uniCharacter = [originalHTML characterAtIndex:i];
if ([[NSString stringWithFormat:#"%C", uniCharacter] isEqualToString:#"<"]) {
insideTag = YES;
}
if ([[NSString stringWithFormat:#"%C", uniCharacter] isEqualToString:#">"]) {
insideTag = NO;
}
if (!insideTag) {
if ([[NSString stringWithFormat:#"%C", uniCharacter] isEqualToString:#" "]) {
convertSpace = YES;
}
}
if (!convertSpace) {
finalHTML = [finalHTML stringByAppendingFormat:[NSString stringWithFormat:#"%C", uniCharacter]];
} else {
finalHTML = [finalHTML stringByAppendingFormat:#" "];
convertSpace = NO;
}
}
NSLog(#"%#", finalHTML);
*Note, this will not work if you just have a less than sign or greater than sign in your html body that is not part of a tag. If you need to write Less Than< or Greater Than> In your actual body text please use < or >

Related

Is there any solution for mix language problem in tesseract 4.1.1?

I want to covert image to text with tesseract engine. Input image has two language(persian and english). When I use tesseract multi language feature(fas+eng), converted text has many error.
For example:
output:
BERT Joo‏ و استفاده از آن
در این گزارش به تعریف مفاهیم مورد نیاز برای شناخت مدل 7۳11 می‌پردازيم و نحوه استفاده از
آن را برای تحلیل متن توضیح می‌دهیم.
Should I train model with persian and english text?
You must update to latest version of tesseract OR fas trainned data.
I use this version of tesseract:
# tesseract.exe --version
tesseract v5.0.0-alpha.20191030
leptonica-1.78.0
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0
Found AVX
Found SSE
Found libarchive 3.3.2 zlib/1.2.11 liblzma/5.2.3 bz2lib/1.0.6 liblz4/1.7.5
And also I use this commit version for fas train data:
https://github.com/tesseract-ocr/tessdata/blob/cdd8a9ec438fc0b9f21635466196fe1c05efca16/fas.traineddata
And I use this command:
tesseract.exe image.png out -l fas+eng
So as you can see in here, We have this correct text:
مدل ‎BERT‏ و استفاده از آن
در این گزارش به تعریف مفاهیم مورد نیاز برای شناخت مدل ‎BERT‏ می‌پردازيم و نحوه استفاده از
آن را برای تحلیل متن توضیح می‌دهیم.
Also see this image:

HTML numbering + indent (+hanging indent)

my question is very simple:
i have a numbered paragraph (in Hebrew (right to left language)) and i want the number to be pulled back and the text will be indented, and also hanging indent. like this picture:
attached picture
NEW PICTURE! I NEED MORE INDENT
here is the text, i know that most will not understand it, but here it is anyway:
ברוכים הבאים לאתר הבית של חברת השטיח האדום – ייבוא שטיחים בע”מ ( ח.פ 515713212) (להלן: ”החברה”). השימוש באתר זה ובתכנים המוצגים בו (להלן: “האתר”) הינו בכפוף לתנאי השימוש שיפורטו להלן (להלן: “תנאי השימוש”). אנא קראו תנאים אלה בעיון ובקפידה, שכן עצם השימוש באתר ותכניו מעידה על הסכמתכם ואישורכם לאמור בתנאי שימוש אלו. החברה שומרת לעצמה את הזכות לעדכן תנאי שימוש אלו, מעת לעת לפי שיקול דעתה הבלעדי וללא צורך במסירת הודעה כלשהי מראש. תוקפו של שינוי תנאי השימוש יחל מרגע פרסומו באתר זה. המונח “משתמש” משמעו כל אדם אשר עושה שימוש באתר.
בכל מקום בו לא נאמר אחרת, כל מאפיין (feature) חדש באתר, אשר משנה, משפר או מציג בצורה אחרת את השירותים הניתנים במסגרתו, יהיה כפוף לתנאי שימוש אלו. במקרה בו יתווספו שירותים נוספים לאתר, ייתכן ותצטרכו להביע את הסכמתכם הנפרדת לתנאים הנוספים המתחייבים מן השימוש בו.
אתר זה נועד לשימוש פרטי בלבד וכל שימוש מסחרי בו ללא קבלת הסכמתה מראש ובכתב של החברה הינו אסור.
החברה תהיה רשאית להפסיק ו/או לשנות את שירותי האתר או חלק מהם בכל עת, לרבות את התכנים, המידע והרשאות הגישה הנדרשים לצורך גישה לשירותי האתר, וזאת מבלי הודעה מוקדמת ומבלי שתשא באחריות לנזקים שייגרמו כתוצאה מכך.
החברה שומרת על זכותה לסרב להעניק גישה לאתר זה או לחלקים ממנו לכל משתמש, לפי שיקול דעתה הבלעדי וללא התראה מוקדמת.
באתר כולל גם מידע ותכנים בעלי אופי אינפורמטיבי ושיווקי. בכל מקרה של סתירה, ידברו תמיד התעריפונים ו/או המחירונים ו/או התנאים הרשמיים של החברה, כפי שהם מופיעים בפרסומים הרשמיים של החברה הזמינים לעיון הציבור במשרדי החברה. בנוסף לכך, כל מבצע ו/או הגרלה ו/או הטבה יהיו כפופים לתקנונים הרשמיים ו/או לתנאים הרשמיים, כפי שיפורסמו על ידי החברה ואשר יהיו זמינים לעיון הציבור במשרדי החברה.
All you need to do is add dir="rtl" to the body element and the text will be displayed as I understand you want it to be. See the attached snippet and click 'Run code snippet' to see it in action.
If you only want it to be applied to this ordered list, then you can do this:
ol {
direction: rtl;
}
Explanation:
The direction CSS property sets the direction of text, table
columns, and horizontal overflow. Use rtl for languages written from
right to left (like Hebrew or Arabic), and ltr for those written from
left to right (like English and most other languages).
Source: MDN
ol li {
padding-right: 20px;
}
<body dir="rtl">
<ol>
<li>
ברוכים הבאים לאתר הבית של חברת השטיח האדום – ייבוא שטיחים בע”מ ( ח.פ 515713212) (להלן: ”החברה”). השימוש באתר זה ובתכנים המוצגים בו (להלן: “האתר”) הינו בכפוף לתנאי השימוש שיפורטו להלן (להלן: “תנאי השימוש”). אנא קראו תנאים אלה בעיון ובקפידה, שכן עצם השימוש
באתר ותכניו מעידה על הסכמתכם ואישורכם לאמור בתנאי שימוש אלו. החברה שומרת לעצמה את הזכות לעדכן תנאי שימוש אלו, מעת לעת לפי שיקול דעתה הבלעדי וללא צורך במסירת הודעה כלשהי מראש. תוקפו של שינוי תנאי השימוש יחל מרגע פרסומו באתר זה. המונח “משתמש” משמעו
כל אדם אשר עושה שימוש באתר.
</li>
<li>
בכל מקום בו לא נאמר אחרת, כל מאפיין (feature) חדש באתר, אשר משנה, משפר או מציג בצורה אחרת את השירותים הניתנים במסגרתו, יהיה כפוף לתנאי שימוש אלו. במקרה בו יתווספו שירותים נוספים לאתר, ייתכן ותצטרכו להביע את הסכמתכם הנפרדת לתנאים הנוספים המתחייבים מן השימוש
בו.
</li>
<li>
אתר זה נועד לשימוש פרטי בלבד וכל שימוש מסחרי בו ללא קבלת הסכמתה מראש ובכתב של החברה הינו אסור. החברה תהיה רשאית להפסיק ו/או לשנות את שירותי האתר או חלק מהם בכל עת, לרבות את התכנים, המידע והרשאות הגישה הנדרשים לצורך גישה לשירותי האתר, וזאת מבלי הודעה מוקדמת
ומבלי שתשא באחריות לנזקים שייגרמו כתוצאה מכך.</li>
<li>
החברה שומרת על זכותה לסרב להעניק גישה לאתר זה או לחלקים ממנו לכל משתמש, לפי שיקול דעתה הבלעדי וללא התראה מוקדמת.</li>
<li>
באתר כולל גם מידע ותכנים בעלי אופי אינפורמטיבי ושיווקי. בכל מקרה של סתירה, ידברו תמיד התעריפונים ו/או המחירונים ו/או התנאים הרשמיים של החברה, כפי שהם מופיעים בפרסומים הרשמיים של החברה הזמינים לעיון הציבור במשרדי החברה. בנוסף לכך, כל מבצע ו/או הגרלה ו/או
הטבה יהיו כפופים לתקנונים הרשמיים ו/או לתנאים הרשמיים, כפי שיפורסמו על ידי החברה ואשר יהיו זמינים לעיון הציבור במשרדי החברה.
</li>
</ol>
</body>

Iroin-ajax response with html tags [duplicate]

This question already has answers here:
How to inject HTML into a template with polymer
(3 answers)
Closed 6 years ago.
I'm getting a JSON feed by iron-ajax, in the returned JSON come with HTML tags like this.
[{
pk :1,
body: "<p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل.
</p> <p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل.".</p> <p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, "بوابة" الفترة بين بل.</p> <!-- Images Box --><div class="img_box01"> <img class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p> </div> <!-- Video --><div class="box video_box"><div class="head"><h2></h2></div> <p>وأدرج بوتيجان على قائمة التطرف منذ 29 حزيران/يونيو لمحاولته التوجه إلى سوريا مرورا بتركيا، بحسب مصدر قريب من التحقيق.<br /> كما أن المنفذ الثاني يشبه إلى حد كبير مشتبها به تبحث عنه السلطات منذ 22 تموز/يوليو أي قبل ثلاثة أيام من الاعتداء الذي تم في كنيسة سانت اتيان دو روفريه بالقرب من روان (شمال غرب).</p> <p>وكان جهاز أجنبي أبلغ هيئة تنسيق مكافحة الإرهاب بوجود رجل لم تعرف هويته "مستعد للمشاركة في اعتداء على الأراضي الفرنسية"، وأرفقت بالبلاغ صورة لشخص يشبه كثيرا عبد المالك بوتيجان.</p> <!-- Images Box --><div class="img_box01"> <img class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p> </div> <!-- Video --><div class="box video_box"><div class="head"><h2></h2></div><div class="content"><div class="arena"><video id="url" dir="ltr" class="video-js vjs-big-play-centered vjs-default-skin" controls preload="auto" width="600" height="338" poster=""><source src="url" type="video/mp4"></source><track kind="captions" src="" srclang="en" label="English"><track kind="captions" src="" srclang="ar" label="Arabic" default><p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading your web browser</p></track></track></video></div></div><div class="foot"></div></div>",
}]
so I create a dom-repeat element to show the results , but when printing the [[body]] , it prints out as text with the HTML tags as text also, so how to print it out as HTML without facing XSS security .
I think you have to insert the HTML imperatively with DOM API (innerHTML).
Here's an example in which I extend <div> to display arbitrary HTML.
Polymer({
is: 'my-elem',
properties: {
ajaxResponse: {
type: Array,
value: [{
pk :1,
body: "<b>some html</b>"
}]
}
}
});
Polymer({
is: 'my-div',
extends: 'div',
properties: {
html: {
type: String,
observer: '_renderHTML'
}
},
_renderHTML: function(html) {
this.innerHTML = html;
}
});
<!DOCTYPE html>
<html>
<head>
<base href="https://polygit.org/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<script>
Polymer = {
dom: 'shadow'
}
</script>
<link href="polymer/polymer.html" rel="import"/>
</head>
<body>
<my-elem></my-elem>
<dom-module id="my-elem">
<template>
<template id="repeater" is="dom-repeat" items="[[ajaxResponse]]">
<div is="my-div" html="[[item.body]]"></div>
</template>
</template>
</dom-module>
</body>
</html>
Note though that it is a possible security threat. You could however sanitize the input HTML inside the <my-div> element. For example by using sanitize-html

CSS- Right to Left Text Content

So I've marked up a responsive page that the client not wants to be in Arabic. When provided with the copy changes I merely copied and pasted the translated text content into the mark up and added 'dir="rtl"' to my html line.
I've now received feedback from the client stating that the text is it is still reading incorrectly. I've removed the tag thinking that perhaps that was the error but I then got the same response. I have absolutely no idea what's wrong with the mark up.
<html class="no-js" dir="rtl">
<h3>عروض الكهرباء أصبحت أكثر تنافسية
</h3>
<p>
لقد تغيرت الكهرباء في نيو ساوث ويلز. فرفع القيود الرقابية عن الكهرباء يعني خطط أكثر تنافسية للكهرباء، والمزيد من الخيارات، وانخفاض أسعار الكهرباء في نيو ساوث ويلز؛ الأمر الذي يعود بالنفع على المنازل والشركات الصغيرة.
</p>
Use this CSS property:
html {
direction: rtl;
}
Or inline CSS like this:
<html class="no-js" style="direction:rtl">
<h3>عروض الكهرباء أصبحت أكثر تنافسية
</h3>
<p>
لقد تغيرت الكهرباء في نيو ساوث ويلز. فرفع القيود الرقابية عن الكهرباء يعني خطط أكثر تنافسية للكهرباء، والمزيد من الخيارات، وانخفاض أسعار الكهرباء في نيو ساوث ويلز؛ الأمر الذي يعود بالنفع على المنازل والشركات الصغيرة.
</p>
simple apply text-align: right; to p tag OR you can apply direction: rtl; also.

Regex html script tag with specific URL

I have html content with a <script> tag in it. In those <script> tags I
have an url pointing to a video.
What I want is replace those html tags with my specific tag which use this pattern : [VIDEO]MY_URL_[/VIDEO]
I'm using hpple for parsing the html content.
I'm using this xPath query : //script
When the parser find a result for my query I'm using this function for extracting the video url :
NSDataDetector* detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil];
NSArray* matches = [detector matchesInString:raw options:0 range:NSMakeRange(0, [raw length])];
NSString *finalUrl = [self urlMatchingRegexResults:matches withExtensionArray:[self videosExtensionsArray]];
if (finalUrl) {
NSString *replacement = [NSString stringWithFormat:#"[%#]%#[/%#]",tag,finalUrl,tag];
NSString *pattern = [NSString stringWithFormat:#"<script.*>.*%#.*</script>",finalUrl];
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil];
NSArray *matches = [regex matchesInString:self.store options:0 range:NSMakeRange(0, self.store.length)];
modifiedString = [regex stringByReplacingMatchesInString: modifiedString options:0 range:NSMakeRange(0, modifiedString.length) withTemplate:replacement];
}
where "raw" is the result of [TFHppleElement raw]
where [self videosExtensionsArray] is an array of videos extensions :
- (NSArray *)videosExtensionsArray {
static NSArray *videosExtensionsArray;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
videosExtensionsArray = #[#"mp4",#"mov",#"avi",#"flv",#"mkv"];
});
return videosExtensionsArray;
}
The problem is that if i have multiple tag in my html content, my regex take the first opening tag and take the last closing tag.
How can i modify my regex to avoid this issue ?
NSString *pattern = [NSString stringWithFormat:#"<script.*>.*%#.*<\\/script>",finalUrl];
EDIT :
Content of the HTML :
<html><body><p style="text-align: center;"><a href="http://www.tuxboard.com/nba-jam-avec-gerald-green/gerald-green-nba-jam/" rel="attachment wp-att-171429">[IMG]http://www.tuxboard.com/photos/2014/03/Gerald-Green-NBA-Jam.jpg[/IMG]
</a>
</p>
<p><span id="more-171399"/><br/>
Si le jeu <strong>NBA Jam</strong> était édité cette année, le joueur des Phoenix Suns <strong>Gerald Green</strong> serait la star en couverture. L’arrière des Suns est à la fois un immense dunkeur avec une détente phénoménale, mais aussi une fine gâchette.</p>
<p style="text-align: center;"><a href="http://www.tuxboard.com/nba-jam-avec-gerald-green/video-nba-jam-gerald-green/" rel="attachment wp-att-171431">[IMG]http://www.tuxboard.com/photos/2014/03/Video-NBA-Jam-Gerald-Green.jpg[/IMG]
</a>
</p>
<p>L’équipe de Phoenix l’a intégré dans le jeu <strong>NBA Jam</strong>, suite à ses performances hors normes face au Thunder avec notamment 41 pts. </p>
<p>On vous laisse savourer cette vidéo, avec une jolie pépite à la fin (on n’en dit pas plus…)</p>
<div id="tuxplayer">Chargement du player …</div>
<p><script type="text/javascript"><![CDATA[jwplayer("tuxplayer").setup({ flashplayer: "http://medias.tuxboard.com/playerv2.swf", file: "http://medias2.tuxboard.com/NBA_Jam_Gerald_Green.mp4",image: "http://www.tuxboard.com/photos/2014/03/NBA-Jam-Gerald-Green-on-Fire-640x357.jpg", height: 370,width: '100%', 'plugins': 'sharing-3'});]]></script></p>
<p>
Les dernières actions du bonhomme qui devrait remporter le titre du joueur ayant le plus progressé !</p>
<p style="text-align: center;">[IMG]http://www.tuxboard.com/photos/2014/03/Gerald-Green-Poster-Mason-Plumlee.gif[/IMG]
</p>
<p style="text-align: center;">[IMG]http://www.tuxboard.com/photos/2013/11/Dunk-Gerald-Green.gif[/IMG]
</p>
<p style="text-align: center;">[IMG]http://www.tuxboard.com/photos/2014/01/gerald-green-windmill.gif[/IMG]
</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/xnzQ3FWc7Oo?feature=oembed" frameborder="0" allowfullscreen=""/></p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/Yyr6mkAbCQw?feature=oembed" frameborder="0" allowfullscreen=""/></p>
<p>Et surement son plus beau dunk :</p>
<p style="text-align: center;">
</p><div id="Gerald">Chargement du player …</div>
<p><script type="text/javascript"><![CDATA[
jwplayer("Gerald").setup({ flashplayer: "http://medias.tuxboard.com/playerv2.swf", file: "http://medias2.tuxboard.com/Gerald_Green_Windmill_Alley-Oop.mp4",image: "http://www.tuxboard.com/photos/2012/03/Video-Gerald-GreenAlley-Oop.jpg", height: 390,width: 640, 'plugins': 'sharing-3'});]]></script></p>
</body></html>
Log of the pattern :
<script.*?>.*http://medias2.tuxboard.com/NBA_Jam_Gerald_Green.mp4.*?</script>
Matching usually finds the longest match, you need the shortest which is indicated by *? for shortest zero or more. See Regular Expressions - ICU User Guide referenced by Apple's `NSRegularExpression" documentation.