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

Kate

Public Member Functions | List of all members
KateRegExp Class Reference

#include <kateregexp.h>

Public Member Functions

 KateRegExp (const QString &pattern, Qt::CaseSensitivity cs=Qt::CaseSensitive, QRegExp::PatternSyntax syntax=QRegExp::RegExp2)
 
QString cap (int nth=0) const
 
int indexIn (const QString &str, int offset, int end) const
 
bool isEmpty () const
 
bool isMultiLine () const
 
bool isValid () const
 
int lastIndexIn (const QString &str, int offset, int end) const
 
int matchedLength () const
 
int numCaptures () const
 
QString pattern () const
 
int pos (int nth=0) const
 
int repairPattern (bool &stillMultiLine)
 

Detailed Description

Definition at line 27 of file kateregexp.h.

Constructor & Destructor Documentation

KateRegExp::KateRegExp ( const QString &  pattern,
Qt::CaseSensitivity  cs = Qt::CaseSensitive,
QRegExp::PatternSyntax  syntax = QRegExp::RegExp2 
)
explicit

Definition at line 24 of file kateregexp.cpp.

Member Function Documentation

QString KateRegExp::cap ( int  nth = 0) const
inline

Definition at line 38 of file kateregexp.h.

int KateRegExp::indexIn ( const QString &  str,
int  offset,
int  end 
) const

Definition at line 308 of file kateregexp.cpp.

bool KateRegExp::isEmpty ( ) const
inline

Definition at line 33 of file kateregexp.h.

bool KateRegExp::isMultiLine ( ) const

States, whether the pattern matches multiple lines, even if it was repaired using repairPattern().

Returns
Whether the pattern matches multiple lines

Definition at line 206 of file kateregexp.cpp.

bool KateRegExp::isValid ( ) const
inline

Definition at line 34 of file kateregexp.h.

int KateRegExp::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 been found when searching forwards, which QRegExp.lastIndexIn does not.

We need this behavior to allow the user to jump back to the last match.

Parameters
strText to search in
offsetOffset (-1 starts from end, -2 from one before the end)
Returns
Index of match or -1 if no match is found

Definition at line 315 of file kateregexp.cpp.

int KateRegExp::matchedLength ( ) const
inline

Definition at line 39 of file kateregexp.h.

int KateRegExp::numCaptures ( ) const
inline

Definition at line 36 of file kateregexp.h.

QString KateRegExp::pattern ( ) const
inline

Definition at line 35 of file kateregexp.h.

int KateRegExp::pos ( int  nth = 0) const
inline

Definition at line 37 of file kateregexp.h.

int KateRegExp::repairPattern ( bool &  stillMultiLine)

Repairs a regular Expression pattern.

This is a workaround to make "." and "\s" not match newlines, which currently is the unconfigurable default in QRegExp.

Parameters
stillMultiLineMulti-line after reparation flag
Returns
Number of replacements done

Definition at line 35 of file kateregexp.cpp.


The documentation for this class was generated from the following files:
  • kateregexp.h
  • kateregexp.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:57:01 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