• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • search
kateregexp.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2009 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
4  * Copyright (C) 2007 Sebastian Pipping <webmaster@hartwork.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _KATE_REGEXP_H_
23 #define _KATE_REGEXP_H_
24 
25 #include <QtCore/QRegExp>
26 
27 class KateRegExp
28 {
29  public:
30  explicit KateRegExp(const QString &pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive,
31  QRegExp::PatternSyntax syntax = QRegExp::RegExp2);
32 
33  bool isEmpty() const { return m_regExp.isEmpty(); }
34  bool isValid() const { return m_regExp.isValid(); }
35  QString pattern() const { return m_regExp.pattern(); }
36  int numCaptures() const { return m_regExp.numCaptures(); }
37  int pos(int nth = 0) const { return m_regExp.pos(nth); }
38  QString cap(int nth = 0) const { return m_regExp.cap(nth); }
39  int matchedLength() const { return m_regExp.matchedLength(); }
40 
41  int indexIn(const QString &str, int offset, int end) const;
42 
54  int lastIndexIn(const QString &str, int offset, int end) const;
55 
65  int repairPattern(bool & stillMultiLine);
66 
73  bool isMultiLine() const;
74 
75  private:
76  QRegExp m_regExp;
77 };
78 
79 #endif // KATEREGEXP_H
80 
81 // kate: space-indent on; indent-width 2; replace-tabs on;
QRegExp::pos
int pos(int nth) const
KateRegExp::lastIndexIn
int lastIndexIn(const QString &str, int offset, int end) const
This function is a replacement for QRegExp.lastIndexIn that returns the last match that would have be...
Definition: kateregexp.cpp:315
KateRegExp::numCaptures
int numCaptures() const
Definition: kateregexp.h:36
QRegExp::cap
QString cap(int nth) const
KateRegExp::pos
int pos(int nth=0) const
Definition: kateregexp.h:37
KateRegExp
Definition: kateregexp.h:27
KateRegExp::repairPattern
int repairPattern(bool &stillMultiLine)
Repairs a regular Expression pattern.
Definition: kateregexp.cpp:35
QRegExp::isEmpty
bool isEmpty() const
KateRegExp::KateRegExp
KateRegExp(const QString &pattern, Qt::CaseSensitivity cs=Qt::CaseSensitive, QRegExp::PatternSyntax syntax=QRegExp::RegExp2)
Definition: kateregexp.cpp:24
KateRegExp::matchedLength
int matchedLength() const
Definition: kateregexp.h:39
KateRegExp::isValid
bool isValid() const
Definition: kateregexp.h:34
QRegExp::numCaptures
int numCaptures() const
KateRegExp::cap
QString cap(int nth=0) const
Definition: kateregexp.h:38
QRegExp::matchedLength
int matchedLength() const
QRegExp
QString
KateRegExp::isMultiLine
bool isMultiLine() const
States, whether the pattern matches multiple lines, even if it was repaired using repairPattern()...
Definition: kateregexp.cpp:206
KateRegExp::isEmpty
bool isEmpty() const
Definition: kateregexp.h:33
KateRegExp::pattern
QString pattern() const
Definition: kateregexp.h:35
QRegExp::isValid
bool isValid() const
QRegExp::pattern
QString pattern() const
KateRegExp::indexIn
int indexIn(const QString &str, int offset, int end) const
Definition: kateregexp.cpp:308
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal