Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
estrarre una sottostringa con espressioni regolari
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
soigres
l33t
l33t


Joined: 09 Dec 2004
Posts: 648
Location: Milano, Italy

PostPosted: Fri Apr 28, 2006 12:47 am    Post subject: estrarre una sottostringa con espressioni regolari Reply with quote

ciao ragazzi
ho bisogno di estrarre da queta riga
Code:
Front Right: Playback 2 [6%] [on]
la stringa
Code:
6%
e pensavo di farlo con le espressioni regolari ma non so quale sia il comando per estrarre una sottostringa...
attenzione, non mi serve sapere l'espressione regolare ma il comando (awk o altro) che la utilizza l'espressione per estrarre la parte che corrisponde alla stringa
grazie!
Back to top
View user's profile Send private message
Cazzantonio
Bodhisattva
Bodhisattva


Joined: 20 Mar 2004
Posts: 4514
Location: Somewere around the world

PostPosted: Fri Apr 28, 2006 1:27 am    Post subject: Reply with quote

Moved from Forum italiano (Italian) to Forum di discussione italiano.

Prego non c'è di che....
C'entrava qualcosa con il supporto tecnico alla distribuzione gentoo?
Esistono comunque diverse guide introduttive alla shell bash che ti consiglio di leggere :wink: Su google trovi tutto :wink:
_________________
Any mans death diminishes me, because I am involved in Mankinde; and therefore never send to know for whom the bell tolls; It tolls for thee.
-John Donne
Back to top
View user's profile Send private message
makoomba
Bodhisattva
Bodhisattva


Joined: 03 Jun 2004
Posts: 1856

PostPosted: Fri Apr 28, 2006 9:52 am    Post subject: Reply with quote

Code:
[root@backup root]# echo "Front Right: Playback 2 [6%] [on]" | cut -d'[' -f2 | cut -d']' -f1
6%

_________________
When all else fails, read the instructions.
Back to top
View user's profile Send private message
soigres
l33t
l33t


Joined: 09 Dec 2004
Posts: 648
Location: Milano, Italy

PostPosted: Fri Apr 28, 2006 9:56 am    Post subject: Reply with quote

Cazzantonio
perdonami per il post sbagliato nella sezione sbagliata
grazie per il suggerimento sulla shell bash... ma i comandi sulle espressioni regolari sono diversi per ogni shell? mi guarderò la bash (che alla fine è quella che uso) per capire quali sono i comandi che fanno uso di espressioni regolari

makoomba
grazie per il suggerimento, forse è la cosa migliore
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Fri Apr 28, 2006 10:53 am    Post subject: Reply with quote

soigres wrote:
grazie per il suggerimento sulla shell bash... ma i comandi sulle espressioni regolari sono diversi per ogni shell?


Alcune piccole differenze potrebbero esserci... peraltro la shell normalmente usa le regex quando espande i parametri o nelle funzioni ${ #% }, solitamente un impiego intensivo delle regex sul testo viene fatto da sed e awk, che sono tool esterni e, anche loro, potrebbero avere qualche piccola differenza sulla sintassi.
_________________
Ciao da me!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum