You can see the above two stings, that $string_2 contents are available in $string_1 but the only difference is tags (ie: <a> or <sup>).
I want to match $string_2 in $string_1 and have to create/copy what are the tags inside in $string_1 matching area to the $string_2 contents.
Kindly anybody give any idea to solve this
Thanks
Vimal - my $string_1 = "Noch befinden wir uns aber in der 1. Generation, so dass diese institutionalisierten Handlungsweisen nach wie vor durchschaubar und als menschliche Konstruktion ersichtlich sind. Der Institutionalisierungsvorgang endet erst im Zuge der <i>Internalisierung</i> der Folgegeneration durch die (Primär)sozialisation, in der die kollektiven Wissensbestände als Teil der subjektiven Wirklichkeit verinnerlicht werden. Erst hierdurch werden die Institutionen als Teil einer absolut wahrgenommenen objektiven Wirklichkeit angesehen. Sie erhalten dadurch objektiven Charakter. Diesen Vorgang der Vergegenständlichung nennt Berger/Luckmann <i>Objektivation</i>. Der Eindruck eines menschlichen Erzeugnisses verschwindet. Die Institutionen werden als naturgegebene, unhinterfragbare und nicht veränderbare faktische Gegebenheiten angesehen, als kollektiv geteilte Wissensbestände. Die Autorität der Institution an sich, die sich aus ihrer historisch bedingten Faktizität ergibt, sowie die Autorität der Bezugspersonen, die gesellschaftliche Institutionen, Normen und Verhaltensweisen übermitteln, führen dabei zu einem regelkonformen Handeln der <a sdj="asdas"><sup>saddfsdfsad</sup></a> Nachkommen (Berger/Luckmann <sup>21</sup>2007, 62–72)."
-
-
my $string_2 = "regelkonformen Handeln der Nachkommen (Berger/Luckmann 2007, 62–72)."
-
-
----------------------------------------------------
-
1 1191
The following script will match at least this example data: -
use strict;
-
use warnings;
-
-
my $string_1 = do {local $/; <DATA>};
-
-
my $string_2 = "regelkonformen Handeln der Nachkommen (Berger/Luckmann 2007, 62–72).";
-
-
# Build a regex to match HTML interjected at whitespace
-
my $string2_re = join '(?:\s+|<(\w+)\b.*?</\g{-1}>)+', map quotemeta, split ' ', $string_2;
-
-
if ($string_1 =~ /($string2_re)/) {
-
print "Matching = '$1'";
-
}
-
-
__DATA__
-
Noch befinden wir uns aber in der 1. Generation,
-
so dass diese institutionalisierten Handlungsweisen nach wie vor durchschaubar
-
und als menschliche Konstruktion ersichtlich sind. Der Institutionalisierungsvorgang
-
endet erst im Zuge der <i>Internalisierung</i> der Folgegeneration durch die
-
(Primär)sozialisation, in der die kollektiven Wissensbestände als Teil
-
der subjektiven Wirklichkeit verinnerlicht werden. Erst hierdurch werden die Institutionen
-
als Teil einer absolut wahrgenommenen objektiven Wirklichkeit angesehen. Sie erhalten
-
dadurch objektiven Charakter. Diesen Vorgang der Vergegenständlichung nennt
-
Berger/Luckmann <i>Objektivation</i>. Der Eindruck eines menschlichen Erzeugnisses
-
verschwindet. Die Institutionen werden als naturgegebene, unhinterfragbare und nicht
-
veränderbare faktische Gegebenheiten angesehen, als kollektiv geteilte
-
Wissensbestände. Die Autorität der Institution an sich, die sich aus ihrer
-
historisch bedingten Faktizität ergibt, sowie die Autorität der
-
Bezugspersonen, die gesellschaftliche Institutionen, Normen und Verhaltensweisen
-
übermitteln, führen dabei zu
-
einem regelkonformen Handeln der <a sdj="asdas"><sup>saddfsdfsad</sup></a> Nachkommen (Berger/Luckmann <sup>21</sup>2007, 62–72).
-
Outputs -
Matching = 'regelkonformen Handeln der <a sdj="asdas"><sup>saddfsdfsad</sup></a> Nachkommen (Berger/Luckmann <sup>21</sup>2007, 62–72).'
-
- Miller
Sign in to post your reply or Sign up for a free account.
Similar topics
by: VinayKumarParakoti |
last post by:
Hi all,
I am new to this site and this is my first post. But this issue is of high priority.
I am trying to print pdf file in browser using perl script.
Onclick on hyperlink a child window...
|
by: atinti |
last post by:
I'm tyring to write something that will send a simple email using Perl
so far this is what I have
#!/usr/bin/perl -w
use strict;
my $executable = "saplotus.exe';
my $server =...
|
by: bashetty |
last post by:
Well its a strange problem i have, some of you might already faced it
and have a solution. I have to maintain a set of unique "search key
words" in meta tags for each content page in my site. With...
|
by: Npreeti |
last post by:
HI ,
I want to copy a file from one machine to another machine using perl.
Also i want to know whether i can past arguments to perl program?
|
by: sainiamit25 |
last post by:
Hi,
I want to parse a file and from some of the attributes of this file, i want to create another file using perl. Can anybody suggest me a way out? It would be great if i dont have to use any...
|
by: Max58kl |
last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window
--------------------------------------------------------------------------------
Hi
I am using a program called...
|
by: jawas |
last post by:
Can any body help to write the general Perl script to transfer file from one window XP machine to another window XP machine and then change the file name and send some command for e.g config, 9,9 to...
|
by: zaxxon25 |
last post by:
I am having an issue with attaching 2 attachments one xip and other excel file with email and sending using perl sendmail. I tried to look on various forums and everywhere i get advice using MIME ::...
|
by: hanz |
last post by:
Hello everyone,
I am trying to create an MS Access file using Perl in a Linux environment. By the way I am on a SuSE Linux envrironment. I have already installed the DBI module. I am looking...
|
by: Anuja T |
last post by:
Hi,
I am dealing with running macros through perl.
i have following script to do the same which is working fine.Now what i have to do is to make one .xlsm (macro-enabled file)which will...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |